@shipload/sdk 2.0.0-rc10 → 2.0.0-rc12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/shipload.d.ts +144 -72
- package/lib/shipload.js +2537 -2238
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +2505 -2224
- package/lib/shipload.m.js.map +1 -1
- package/package.json +2 -2
- package/src/capabilities/gathering.ts +36 -0
- package/src/capabilities/guards.ts +3 -3
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/modules.ts +4 -4
- package/src/capabilities/storage.ts +92 -2
- package/src/contracts/server.ts +53 -16
- package/src/data/capabilities.ts +28 -28
- package/src/data/categories.ts +1 -1
- package/src/data/colors.ts +1 -0
- package/src/data/recipes.ts +25 -25
- package/src/derivation/crafting.ts +76 -0
- package/src/derivation/index.ts +3 -1
- package/src/derivation/resources.ts +1 -7
- package/src/derivation/stratum.ts +21 -17
- package/src/derivation/tiers.ts +54 -0
- package/src/entities/location.ts +3 -3
- package/src/entities/ship-deploy.ts +17 -17
- package/src/entities/ship.ts +4 -4
- package/src/errors.ts +5 -0
- package/src/index-module.ts +22 -13
- package/src/managers/actions.ts +6 -3
- package/src/market/items.ts +69 -10
- package/src/nft/description.ts +11 -11
- package/src/resolution/resolve-item.ts +7 -7
- package/src/scheduling/projection.ts +86 -77
- package/src/scheduling/schedule.ts +2 -2
- package/src/types/capabilities.ts +5 -5
- package/src/types/entity.ts +1 -1
- package/src/types.ts +3 -2
- package/src/utils/system.ts +14 -1
- package/src/capabilities/extraction.ts +0 -36
package/lib/shipload.d.ts
CHANGED
|
@@ -306,6 +306,12 @@ declare namespace Types {
|
|
|
306
306
|
seed: UInt64;
|
|
307
307
|
entity_name: string;
|
|
308
308
|
}
|
|
309
|
+
class descentity extends Struct {
|
|
310
|
+
item_id: UInt16;
|
|
311
|
+
hull_seed: UInt64;
|
|
312
|
+
module_items: UInt16[];
|
|
313
|
+
module_seeds: UInt64[];
|
|
314
|
+
}
|
|
309
315
|
class enable extends Struct {
|
|
310
316
|
enabled: boolean;
|
|
311
317
|
}
|
|
@@ -326,11 +332,11 @@ declare namespace Types {
|
|
|
326
332
|
thrust: UInt32;
|
|
327
333
|
drain: UInt16;
|
|
328
334
|
}
|
|
329
|
-
class
|
|
330
|
-
|
|
335
|
+
class gatherer_stats extends Struct {
|
|
336
|
+
yield: UInt16;
|
|
331
337
|
drain: UInt16;
|
|
332
338
|
depth: UInt16;
|
|
333
|
-
|
|
339
|
+
speed: UInt16;
|
|
334
340
|
}
|
|
335
341
|
class hauler_stats extends Struct {
|
|
336
342
|
capacity: UInt8;
|
|
@@ -354,7 +360,7 @@ declare namespace Types {
|
|
|
354
360
|
engines?: movement_stats;
|
|
355
361
|
generator?: energy_stats;
|
|
356
362
|
capacity?: UInt32;
|
|
357
|
-
|
|
363
|
+
gatherer?: gatherer_stats;
|
|
358
364
|
hauler?: hauler_stats;
|
|
359
365
|
warp?: warp_stats;
|
|
360
366
|
crafter?: crafter_stats;
|
|
@@ -386,7 +392,7 @@ declare namespace Types {
|
|
|
386
392
|
id: UInt64;
|
|
387
393
|
participants: entity_ref[];
|
|
388
394
|
}
|
|
389
|
-
class
|
|
395
|
+
class gather extends Struct {
|
|
390
396
|
entity_type: Name;
|
|
391
397
|
id: UInt64;
|
|
392
398
|
stratum: UInt16;
|
|
@@ -669,10 +675,10 @@ declare namespace Types {
|
|
|
669
675
|
engines?: movement_stats;
|
|
670
676
|
generator?: energy_stats;
|
|
671
677
|
loaders?: loader_stats;
|
|
672
|
-
|
|
673
|
-
hauler?: hauler_stats;
|
|
678
|
+
gatherer?: gatherer_stats;
|
|
674
679
|
warp?: warp_stats;
|
|
675
680
|
crafter?: crafter_stats;
|
|
681
|
+
hauler?: hauler_stats;
|
|
676
682
|
modules: module_entry[];
|
|
677
683
|
schedule?: schedule;
|
|
678
684
|
}
|
|
@@ -681,6 +687,12 @@ declare namespace Types {
|
|
|
681
687
|
item_id: UInt64;
|
|
682
688
|
quantity: UInt64;
|
|
683
689
|
}
|
|
690
|
+
class spawnpacked extends Struct {
|
|
691
|
+
entity_id: UInt64;
|
|
692
|
+
item_id: UInt16;
|
|
693
|
+
hull_seed: UInt64;
|
|
694
|
+
installed: cargo_seed[];
|
|
695
|
+
}
|
|
684
696
|
class spawnseeded extends Struct {
|
|
685
697
|
entity_id: UInt64;
|
|
686
698
|
item_id: UInt64;
|
|
@@ -919,10 +931,16 @@ declare namespace ActionParams {
|
|
|
919
931
|
seed: UInt64Type;
|
|
920
932
|
entity_name: string;
|
|
921
933
|
}
|
|
934
|
+
interface descentity {
|
|
935
|
+
item_id: UInt16Type;
|
|
936
|
+
hull_seed: UInt64Type;
|
|
937
|
+
module_items: UInt16Type[];
|
|
938
|
+
module_seeds: UInt64Type[];
|
|
939
|
+
}
|
|
922
940
|
interface enable {
|
|
923
941
|
enabled: boolean;
|
|
924
942
|
}
|
|
925
|
-
interface
|
|
943
|
+
interface gather {
|
|
926
944
|
entity_type: NameType;
|
|
927
945
|
id: UInt64Type;
|
|
928
946
|
stratum: UInt16Type;
|
|
@@ -1032,6 +1050,12 @@ declare namespace ActionParams {
|
|
|
1032
1050
|
item_id: UInt64Type;
|
|
1033
1051
|
quantity: UInt64Type;
|
|
1034
1052
|
}
|
|
1053
|
+
interface spawnpacked {
|
|
1054
|
+
entity_id: UInt64Type;
|
|
1055
|
+
item_id: UInt16Type;
|
|
1056
|
+
hull_seed: UInt64Type;
|
|
1057
|
+
installed: Type.cargo_seed[];
|
|
1058
|
+
}
|
|
1035
1059
|
interface spawnseeded {
|
|
1036
1060
|
entity_id: UInt64Type;
|
|
1037
1061
|
item_id: UInt64Type;
|
|
@@ -1084,8 +1108,9 @@ interface ActionNameParams {
|
|
|
1084
1108
|
craft: ActionParams.craft;
|
|
1085
1109
|
createentity: ActionParams.createentity;
|
|
1086
1110
|
deploy: ActionParams.deploy;
|
|
1111
|
+
descentity: ActionParams.descentity;
|
|
1087
1112
|
enable: ActionParams.enable;
|
|
1088
|
-
|
|
1113
|
+
gather: ActionParams.gather;
|
|
1089
1114
|
getconfig: ActionParams.getconfig;
|
|
1090
1115
|
getentities: ActionParams.getentities;
|
|
1091
1116
|
getentity: ActionParams.getentity;
|
|
@@ -1115,6 +1140,7 @@ interface ActionNameParams {
|
|
|
1115
1140
|
salt: ActionParams.salt;
|
|
1116
1141
|
setnftcfg: ActionParams.setnftcfg;
|
|
1117
1142
|
spawncargo: ActionParams.spawncargo;
|
|
1143
|
+
spawnpacked: ActionParams.spawnpacked;
|
|
1118
1144
|
spawnseeded: ActionParams.spawnseeded;
|
|
1119
1145
|
transfer: ActionParams.transfer;
|
|
1120
1146
|
travel: ActionParams.travel;
|
|
@@ -1128,7 +1154,8 @@ interface ActionReturnValues {
|
|
|
1128
1154
|
cancel: Types.cancel_results;
|
|
1129
1155
|
craft: Types.task_results;
|
|
1130
1156
|
deploy: Types.task_results;
|
|
1131
|
-
|
|
1157
|
+
descentity: string;
|
|
1158
|
+
gather: Types.task_results;
|
|
1132
1159
|
getconfig: Types.game_config;
|
|
1133
1160
|
getentities: Types.entity_info[];
|
|
1134
1161
|
getentity: Types.entity_info;
|
|
@@ -1238,6 +1265,11 @@ declare const SHIP_CARGO_NOT_LOADED = "Cannot unload cargo that is not loaded.";
|
|
|
1238
1265
|
declare const WAREHOUSE_NOT_FOUND = "Cannot find warehouse for given id.";
|
|
1239
1266
|
declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this location.";
|
|
1240
1267
|
declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
|
|
1268
|
+
declare const ENTITY_CAPACITY_EXCEEDED = "Entity cargo capacity would be exceeded.";
|
|
1269
|
+
declare const RECIPE_INPUTS_INSUFFICIENT = "Insufficient inputs for recipe.";
|
|
1270
|
+
declare const RECIPE_INPUTS_INVALID = "Input cargo does not match recipe requirements.";
|
|
1271
|
+
declare const RECIPE_INPUTS_EXCESS = "Provided inputs exceed recipe requirements.";
|
|
1272
|
+
declare const RECIPE_INPUTS_MIXED = "All stacks for a recipe input must be the same resource.";
|
|
1241
1273
|
|
|
1242
1274
|
declare const PRECISION = 10000;
|
|
1243
1275
|
declare const CRAFT_ENERGY_DIVISOR = 150000;
|
|
@@ -1270,11 +1302,12 @@ declare enum TaskType {
|
|
|
1270
1302
|
RECHARGE = 2,
|
|
1271
1303
|
LOAD = 3,
|
|
1272
1304
|
UNLOAD = 4,
|
|
1273
|
-
|
|
1305
|
+
GATHER = 5,
|
|
1274
1306
|
WARP = 6,
|
|
1275
1307
|
CRAFT = 7,
|
|
1276
1308
|
DEPLOY = 8,
|
|
1277
|
-
|
|
1309
|
+
WRAP = 9,
|
|
1310
|
+
UNWRAP = 10
|
|
1278
1311
|
}
|
|
1279
1312
|
declare enum LocationType {
|
|
1280
1313
|
EMPTY = 0,
|
|
@@ -1445,7 +1478,7 @@ declare class ActionsManager extends BaseManager {
|
|
|
1445
1478
|
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
|
|
1446
1479
|
foundCompany(account: NameType, name: string): Action;
|
|
1447
1480
|
join(account: NameType): Action;
|
|
1448
|
-
|
|
1481
|
+
gather(shipId: UInt64Type, stratum: number, quantity: number): Action;
|
|
1449
1482
|
warp(shipId: UInt64Type, destination: CoordinatesType): Action;
|
|
1450
1483
|
craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
1451
1484
|
blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
@@ -1503,8 +1536,8 @@ interface StorageCapability {
|
|
|
1503
1536
|
interface LoaderCapability {
|
|
1504
1537
|
loaders: Types.loader_stats;
|
|
1505
1538
|
}
|
|
1506
|
-
interface
|
|
1507
|
-
|
|
1539
|
+
interface GathererCapability {
|
|
1540
|
+
gatherer: Types.gatherer_stats;
|
|
1508
1541
|
}
|
|
1509
1542
|
interface MassCapability {
|
|
1510
1543
|
hullmass: UInt32;
|
|
@@ -1518,7 +1551,7 @@ interface EntityCapabilities {
|
|
|
1518
1551
|
engines?: Types.movement_stats;
|
|
1519
1552
|
generator?: Types.energy_stats;
|
|
1520
1553
|
loaders?: Types.loader_stats;
|
|
1521
|
-
|
|
1554
|
+
gatherer?: Types.gatherer_stats;
|
|
1522
1555
|
crafter?: Types.crafter_stats;
|
|
1523
1556
|
}
|
|
1524
1557
|
interface EntityState {
|
|
@@ -1531,9 +1564,45 @@ interface EntityState {
|
|
|
1531
1564
|
declare function capsHasMovement(caps: EntityCapabilities): boolean;
|
|
1532
1565
|
declare function capsHasStorage(caps: EntityCapabilities): boolean;
|
|
1533
1566
|
declare function capsHasLoaders(caps: EntityCapabilities): boolean;
|
|
1534
|
-
declare function
|
|
1567
|
+
declare function capsHasGatherer(caps: EntityCapabilities): boolean;
|
|
1535
1568
|
declare function capsHasMass(caps: EntityCapabilities): boolean;
|
|
1536
1569
|
|
|
1570
|
+
interface HasCargo {
|
|
1571
|
+
cargo: Types.cargo_item[];
|
|
1572
|
+
}
|
|
1573
|
+
interface HasCapacity {
|
|
1574
|
+
capacity: UInt32;
|
|
1575
|
+
}
|
|
1576
|
+
interface HasCargomass {
|
|
1577
|
+
cargomass: UInt32;
|
|
1578
|
+
}
|
|
1579
|
+
interface MassInput {
|
|
1580
|
+
item_id: UInt16;
|
|
1581
|
+
quantity: UInt32;
|
|
1582
|
+
modules: Types.module_entry[];
|
|
1583
|
+
}
|
|
1584
|
+
declare function calcCargoItemMass(item: MassInput): UInt64;
|
|
1585
|
+
declare function calcCargoMass(entity: HasCargo): UInt64;
|
|
1586
|
+
declare function calcStacksMass(stacks: CargoStack[]): UInt64;
|
|
1587
|
+
declare function availableCapacity$1(entity: StorageCapability): UInt64;
|
|
1588
|
+
declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
|
|
1589
|
+
declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
|
|
1590
|
+
declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
|
|
1591
|
+
declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
|
|
1592
|
+
declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
|
|
1593
|
+
interface CargoStack {
|
|
1594
|
+
item_id: UInt16;
|
|
1595
|
+
quantity: UInt32;
|
|
1596
|
+
seed?: UInt64;
|
|
1597
|
+
modules: Types.module_entry[];
|
|
1598
|
+
}
|
|
1599
|
+
declare function cargoItemToStack(item: Types.cargo_item): CargoStack;
|
|
1600
|
+
declare function stackToCargoItem(stack: CargoStack): Types.cargo_item;
|
|
1601
|
+
declare function stackKey(s: CargoStack): string;
|
|
1602
|
+
declare function stacksEqual(a: CargoStack, b: CargoStack): boolean;
|
|
1603
|
+
declare function mergeStacks(stacks: CargoStack[], add: CargoStack): CargoStack[];
|
|
1604
|
+
declare function removeFromStacks(stacks: CargoStack[], remove: CargoStack): CargoStack[];
|
|
1605
|
+
|
|
1537
1606
|
type Schedule = Types.schedule;
|
|
1538
1607
|
type Task$1 = Types.task;
|
|
1539
1608
|
interface ScheduleData {
|
|
@@ -1580,7 +1649,7 @@ declare function isInFlight(entity: ScheduleData, now: Date): boolean;
|
|
|
1580
1649
|
declare function isRecharging(entity: ScheduleData, now: Date): boolean;
|
|
1581
1650
|
declare function isLoading(entity: ScheduleData, now: Date): boolean;
|
|
1582
1651
|
declare function isUnloading(entity: ScheduleData, now: Date): boolean;
|
|
1583
|
-
declare function
|
|
1652
|
+
declare function isGathering(entity: ScheduleData, now: Date): boolean;
|
|
1584
1653
|
|
|
1585
1654
|
type schedule_ScheduleData = ScheduleData;
|
|
1586
1655
|
type schedule_Scheduleable = Scheduleable;
|
|
@@ -1605,7 +1674,7 @@ declare const schedule_isInFlight: typeof isInFlight;
|
|
|
1605
1674
|
declare const schedule_isRecharging: typeof isRecharging;
|
|
1606
1675
|
declare const schedule_isLoading: typeof isLoading;
|
|
1607
1676
|
declare const schedule_isUnloading: typeof isUnloading;
|
|
1608
|
-
declare const
|
|
1677
|
+
declare const schedule_isGathering: typeof isGathering;
|
|
1609
1678
|
declare namespace schedule {
|
|
1610
1679
|
export {
|
|
1611
1680
|
schedule_ScheduleData as ScheduleData,
|
|
@@ -1632,20 +1701,21 @@ declare namespace schedule {
|
|
|
1632
1701
|
schedule_isRecharging as isRecharging,
|
|
1633
1702
|
schedule_isLoading as isLoading,
|
|
1634
1703
|
schedule_isUnloading as isUnloading,
|
|
1635
|
-
|
|
1704
|
+
schedule_isGathering as isGathering,
|
|
1636
1705
|
};
|
|
1637
1706
|
}
|
|
1638
1707
|
|
|
1639
1708
|
interface ProjectedEntity {
|
|
1640
1709
|
location: Coordinates;
|
|
1641
1710
|
energy: UInt16;
|
|
1642
|
-
|
|
1711
|
+
cargo: CargoStack[];
|
|
1643
1712
|
shipMass: UInt32;
|
|
1644
1713
|
capacity?: UInt64;
|
|
1645
1714
|
engines?: Types.movement_stats;
|
|
1646
1715
|
loaders?: Types.loader_stats;
|
|
1647
1716
|
generator?: Types.energy_stats;
|
|
1648
1717
|
hauler?: Types.hauler_stats;
|
|
1718
|
+
readonly cargoMass: UInt64;
|
|
1649
1719
|
readonly totalMass: UInt64;
|
|
1650
1720
|
hasMovement(): boolean;
|
|
1651
1721
|
hasStorage(): boolean;
|
|
@@ -1668,6 +1738,7 @@ interface Projectable extends ScheduleData {
|
|
|
1668
1738
|
}
|
|
1669
1739
|
declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
|
|
1670
1740
|
declare function projectEntity(entity: Projectable): ProjectedEntity;
|
|
1741
|
+
declare function validateSchedule(entity: Projectable): void;
|
|
1671
1742
|
declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
|
|
1672
1743
|
|
|
1673
1744
|
declare class Location {
|
|
@@ -1679,7 +1750,7 @@ declare class Location {
|
|
|
1679
1750
|
static from(coordinates: CoordinatesType): Location;
|
|
1680
1751
|
hasSystemAt(gameSeed: Checksum256Type): boolean;
|
|
1681
1752
|
getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
|
|
1682
|
-
|
|
1753
|
+
isGatherableAt(gameSeed: Checksum256Type): boolean;
|
|
1683
1754
|
findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
|
|
1684
1755
|
equals(other: CoordinatesType | Location): boolean;
|
|
1685
1756
|
get epoch(): UInt64 | undefined;
|
|
@@ -1722,24 +1793,6 @@ declare class EntityInventory extends Types.cargo_item {
|
|
|
1722
1793
|
get isEmpty(): boolean;
|
|
1723
1794
|
}
|
|
1724
1795
|
|
|
1725
|
-
interface HasCargo {
|
|
1726
|
-
cargo: Types.cargo_item[];
|
|
1727
|
-
}
|
|
1728
|
-
interface HasCapacity {
|
|
1729
|
-
capacity: UInt32;
|
|
1730
|
-
}
|
|
1731
|
-
interface HasCargomass {
|
|
1732
|
-
cargomass: UInt32;
|
|
1733
|
-
}
|
|
1734
|
-
declare function calcCargoItemMass(item: Types.cargo_item): UInt64;
|
|
1735
|
-
declare function calcCargoMass(entity: HasCargo): UInt64;
|
|
1736
|
-
declare function availableCapacity$1(entity: StorageCapability): UInt64;
|
|
1737
|
-
declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
|
|
1738
|
-
declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
|
|
1739
|
-
declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
|
|
1740
|
-
declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
|
|
1741
|
-
declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
|
|
1742
|
-
|
|
1743
1796
|
declare class InventoryAccessor {
|
|
1744
1797
|
private readonly entity;
|
|
1745
1798
|
private _items?;
|
|
@@ -1787,10 +1840,10 @@ declare class Ship extends Types.entity_info {
|
|
|
1787
1840
|
isRecharging(now: Date): boolean;
|
|
1788
1841
|
isLoading(now: Date): boolean;
|
|
1789
1842
|
isUnloading(now: Date): boolean;
|
|
1790
|
-
|
|
1843
|
+
isGathering(now: Date): boolean;
|
|
1791
1844
|
get hasEngines(): boolean;
|
|
1792
1845
|
get hasGenerator(): boolean;
|
|
1793
|
-
get
|
|
1846
|
+
get hasGatherer(): boolean;
|
|
1794
1847
|
get hasWarp(): boolean;
|
|
1795
1848
|
project(): ProjectedEntity;
|
|
1796
1849
|
projectAt(now: Date): ProjectedEntity;
|
|
@@ -1936,7 +1989,8 @@ declare function getItem(itemId: UInt16Type): Item;
|
|
|
1936
1989
|
declare function getItems(): Item[];
|
|
1937
1990
|
|
|
1938
1991
|
declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
|
|
1939
|
-
declare function
|
|
1992
|
+
declare function isGatherableLocation(locationType: LocationType): boolean;
|
|
1993
|
+
declare function getLocationTypeName(type: LocationType): string;
|
|
1940
1994
|
declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
|
|
1941
1995
|
declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
|
|
1942
1996
|
declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
|
|
@@ -1977,7 +2031,16 @@ declare function getResourceTier(itemId: number): ResourceTier;
|
|
|
1977
2031
|
declare function getResourceWeight(itemId: number, stratum: number): number;
|
|
1978
2032
|
declare function getLocationCandidates(locationType: number, subtype: number): number[];
|
|
1979
2033
|
declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
|
|
1980
|
-
|
|
2034
|
+
|
|
2035
|
+
type ReserveTier = 'small' | 'medium' | 'large' | 'massive' | 'motherlode';
|
|
2036
|
+
interface TierRange {
|
|
2037
|
+
min: number;
|
|
2038
|
+
max: number;
|
|
2039
|
+
}
|
|
2040
|
+
declare const RESERVE_TIERS: Record<ReserveTier, TierRange>;
|
|
2041
|
+
declare const TIER_ROLL_MAX = 65536;
|
|
2042
|
+
declare function rollTier(tierRoll: number, stratum: number): ReserveTier;
|
|
2043
|
+
declare function rollWithinTier(withinRoll: number, range: TierRange): number;
|
|
1981
2044
|
|
|
1982
2045
|
interface StatDefinition {
|
|
1983
2046
|
key: string;
|
|
@@ -2036,6 +2099,15 @@ declare function blendCargoStacks(itemId: number, stacks: {
|
|
|
2036
2099
|
quantity: number;
|
|
2037
2100
|
seed: UInt64;
|
|
2038
2101
|
}[]): UInt64;
|
|
2102
|
+
interface RecipeSlotInput {
|
|
2103
|
+
itemId: number;
|
|
2104
|
+
category: ResourceCategory | undefined;
|
|
2105
|
+
stacks: {
|
|
2106
|
+
quantity: number;
|
|
2107
|
+
seed: bigint;
|
|
2108
|
+
}[];
|
|
2109
|
+
}
|
|
2110
|
+
declare function computeCraftedOutputSeed(outputItemId: number, slotInputs: RecipeSlotInput[]): UInt64;
|
|
2039
2111
|
|
|
2040
2112
|
declare function hash(seed: Checksum256Type, string: string): Checksum256;
|
|
2041
2113
|
declare function hash512(seed: Checksum256Type, string: string): Checksum512;
|
|
@@ -2164,7 +2236,7 @@ interface Entity {
|
|
|
2164
2236
|
location: Coordinates | Types.coordinates;
|
|
2165
2237
|
}
|
|
2166
2238
|
type ShipEntity = Entity & Partial<MovementCapability> & Partial<EnergyCapability> & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability & {
|
|
2167
|
-
|
|
2239
|
+
gatherer?: Types.gatherer_stats;
|
|
2168
2240
|
};
|
|
2169
2241
|
type WarehouseEntity = Entity & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability;
|
|
2170
2242
|
type ContainerEntity = Entity & StorageCapability & MassCapability & ScheduleCapability;
|
|
@@ -2176,7 +2248,7 @@ declare function hasStorage(e: Entity): e is Entity & StorageCapability;
|
|
|
2176
2248
|
declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
|
|
2177
2249
|
declare function hasMass(e: Entity): e is Entity & MassCapability;
|
|
2178
2250
|
declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
|
|
2179
|
-
declare function
|
|
2251
|
+
declare function hasGatherer(e: Entity): e is Entity & GathererCapability;
|
|
2180
2252
|
|
|
2181
2253
|
declare function maxTravelDistance(entity: MovementCapability): UInt32;
|
|
2182
2254
|
declare function calcEnergyUsage(entity: MovementCapability, distance: UInt64): UInt64;
|
|
@@ -2185,8 +2257,8 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
|
|
|
2185
2257
|
|
|
2186
2258
|
declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
|
|
2187
2259
|
|
|
2188
|
-
declare function
|
|
2189
|
-
declare function
|
|
2260
|
+
declare function calc_gather_duration(gatherer: Types.gatherer_stats, itemMass: number, quantity: number, stratum: number, richness: number): UInt32;
|
|
2261
|
+
declare function calc_gather_energy(gatherer: Types.gatherer_stats, duration: number): UInt16;
|
|
2190
2262
|
|
|
2191
2263
|
interface CrafterCapability {
|
|
2192
2264
|
crafter: Types.crafter_stats;
|
|
@@ -2197,7 +2269,7 @@ declare function calc_craft_energy(drain: number, totalInputMass: number): UInt1
|
|
|
2197
2269
|
|
|
2198
2270
|
declare const ITEM_ENGINE_T1 = 10100;
|
|
2199
2271
|
declare const ITEM_GENERATOR_T1 = 10101;
|
|
2200
|
-
declare const
|
|
2272
|
+
declare const ITEM_GATHERER_T1 = 10102;
|
|
2201
2273
|
declare const ITEM_LOADER_T1 = 10103;
|
|
2202
2274
|
declare const ITEM_MANUFACTURING_T1 = 10104;
|
|
2203
2275
|
declare const ITEM_STORAGE_T1 = 10105;
|
|
@@ -2205,7 +2277,7 @@ declare const ITEM_HAULER_T1 = 10106;
|
|
|
2205
2277
|
declare const MODULE_ANY = 0;
|
|
2206
2278
|
declare const MODULE_ENGINE = 1;
|
|
2207
2279
|
declare const MODULE_GENERATOR = 2;
|
|
2208
|
-
declare const
|
|
2280
|
+
declare const MODULE_GATHERER = 3;
|
|
2209
2281
|
declare const MODULE_LOADER = 4;
|
|
2210
2282
|
declare const MODULE_WARP = 5;
|
|
2211
2283
|
declare const MODULE_CRAFTER = 6;
|
|
@@ -2285,8 +2357,8 @@ declare function getStatMappings(): StatMapping[];
|
|
|
2285
2357
|
declare function getStatMappingsForStat(stat: string): StatMapping[];
|
|
2286
2358
|
declare function getStatMappingsForCapability(capability: string): StatMapping[];
|
|
2287
2359
|
|
|
2288
|
-
declare const
|
|
2289
|
-
declare const
|
|
2360
|
+
declare const ITEM_MATTER_CONDUIT = 10005;
|
|
2361
|
+
declare const ITEM_SURVEY_PROBE = 10006;
|
|
2290
2362
|
declare const ITEM_CARGO_ARM = 10007;
|
|
2291
2363
|
declare const ITEM_TOOL_BIT = 10008;
|
|
2292
2364
|
declare const ITEM_REACTION_CHAMBER = 10009;
|
|
@@ -2387,11 +2459,11 @@ declare function computeGeneratorCapabilities(stats: Record<string, number>): {
|
|
|
2387
2459
|
capacity: number;
|
|
2388
2460
|
recharge: number;
|
|
2389
2461
|
};
|
|
2390
|
-
declare function
|
|
2391
|
-
|
|
2462
|
+
declare function computeGathererCapabilities(stats: Record<string, number>): {
|
|
2463
|
+
yield: number;
|
|
2392
2464
|
drain: number;
|
|
2393
2465
|
depth: number;
|
|
2394
|
-
|
|
2466
|
+
speed: number;
|
|
2395
2467
|
};
|
|
2396
2468
|
declare function computeLoaderCapabilities(stats: Record<string, number>): {
|
|
2397
2469
|
mass: number;
|
|
@@ -2423,11 +2495,11 @@ interface ShipCapabilities {
|
|
|
2423
2495
|
capacity: number;
|
|
2424
2496
|
recharge: number;
|
|
2425
2497
|
};
|
|
2426
|
-
|
|
2427
|
-
|
|
2498
|
+
gatherer?: {
|
|
2499
|
+
yield: number;
|
|
2428
2500
|
drain: number;
|
|
2429
2501
|
depth: number;
|
|
2430
|
-
|
|
2502
|
+
speed: number;
|
|
2431
2503
|
};
|
|
2432
2504
|
hauler?: {
|
|
2433
2505
|
capacity: number;
|
|
@@ -2523,10 +2595,10 @@ declare const computeEngineThrust: (vol: number) => number;
|
|
|
2523
2595
|
declare const computeEngineDrain: (thm: number) => number;
|
|
2524
2596
|
declare const computeGeneratorCap: (res: number) => number;
|
|
2525
2597
|
declare const computeGeneratorRech: (clr: number) => number;
|
|
2526
|
-
declare const
|
|
2527
|
-
declare const
|
|
2528
|
-
declare const
|
|
2529
|
-
declare const
|
|
2598
|
+
declare const computeGathererYield: (str: number) => number;
|
|
2599
|
+
declare const computeGathererDrain: (con: number) => number;
|
|
2600
|
+
declare const computeGathererDepth: (tol: number) => number;
|
|
2601
|
+
declare const computeGathererSpeed: (ref: number) => number;
|
|
2530
2602
|
declare const computeLoaderMass: (duc: number) => number;
|
|
2531
2603
|
declare const computeLoaderThrust: (pla: number) => number;
|
|
2532
2604
|
declare const computeCrafterSpeed: (rea: number) => number;
|
|
@@ -2554,10 +2626,10 @@ declare const index_computeEngineThrust: typeof computeEngineThrust;
|
|
|
2554
2626
|
declare const index_computeEngineDrain: typeof computeEngineDrain;
|
|
2555
2627
|
declare const index_computeGeneratorCap: typeof computeGeneratorCap;
|
|
2556
2628
|
declare const index_computeGeneratorRech: typeof computeGeneratorRech;
|
|
2557
|
-
declare const
|
|
2558
|
-
declare const
|
|
2559
|
-
declare const
|
|
2560
|
-
declare const
|
|
2629
|
+
declare const index_computeGathererYield: typeof computeGathererYield;
|
|
2630
|
+
declare const index_computeGathererDrain: typeof computeGathererDrain;
|
|
2631
|
+
declare const index_computeGathererDepth: typeof computeGathererDepth;
|
|
2632
|
+
declare const index_computeGathererSpeed: typeof computeGathererSpeed;
|
|
2561
2633
|
declare const index_computeLoaderMass: typeof computeLoaderMass;
|
|
2562
2634
|
declare const index_computeLoaderThrust: typeof computeLoaderThrust;
|
|
2563
2635
|
declare const index_computeCrafterSpeed: typeof computeCrafterSpeed;
|
|
@@ -2586,10 +2658,10 @@ declare namespace index {
|
|
|
2586
2658
|
index_computeEngineDrain as computeEngineDrain,
|
|
2587
2659
|
index_computeGeneratorCap as computeGeneratorCap,
|
|
2588
2660
|
index_computeGeneratorRech as computeGeneratorRech,
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2661
|
+
index_computeGathererYield as computeGathererYield,
|
|
2662
|
+
index_computeGathererDrain as computeGathererDrain,
|
|
2663
|
+
index_computeGathererDepth as computeGathererDepth,
|
|
2664
|
+
index_computeGathererSpeed as computeGathererSpeed,
|
|
2593
2665
|
index_computeLoaderMass as computeLoaderMass,
|
|
2594
2666
|
index_computeLoaderThrust as computeLoaderThrust,
|
|
2595
2667
|
index_computeCrafterSpeed as computeCrafterSpeed,
|
|
@@ -2608,10 +2680,10 @@ type task = Types.task;
|
|
|
2608
2680
|
type cargo_item = Types.cargo_item;
|
|
2609
2681
|
type warehouse_row = Types.warehouse_row;
|
|
2610
2682
|
type container_row = Types.container_row;
|
|
2611
|
-
type
|
|
2683
|
+
type gatherer_stats = Types.gatherer_stats;
|
|
2612
2684
|
type location_static = Types.location_static;
|
|
2613
2685
|
type location_epoch = Types.location_epoch;
|
|
2614
2686
|
type location_derived = Types.location_derived;
|
|
2615
2687
|
type location_row = Types.location_row;
|
|
2616
2688
|
|
|
2617
|
-
export { ActionsManager, AnyEntity, BASE_ORBITAL_MASS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CapabilityAttribute, CargoData, CargoMassInfo, CargoSeed, CategoryInfo, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CraftedItemCategory, CrafterCapability, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime,
|
|
2689
|
+
export { ActionsManager, AnyEntity, BASE_ORBITAL_MASS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CapabilityAttribute, CargoData, CargoMassInfo, CargoSeed, CargoStack, CategoryInfo, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CraftedItemCategory, CrafterCapability, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, Distance, ENTITY_CAPACITY_EXCEEDED, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, GathererCapability, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_DOES_NOT_EXIST, ITEM_ENGINE_T1, ITEM_FOCUSING_ARRAY, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MANUFACTURING_T1, ITEM_MATTER_CONDUIT, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_SURVEY_PROBE, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CRAFTER, MODULE_ENGINE, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_STORAGE, MODULE_WARP, MassCapability, ModuleEntry, ModuleRecipe, ModuleSlot, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RecipeInput, RecipeSlotInput, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, StackInput, StatDefinition, StatMapping, StorageCapability, StratumInfo, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TierRange, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryIcons, categoryItemMass, componentIcon, components, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputSeed, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererSpeed, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeManufacturingCapabilities, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, distanceBetweenCoordinates, distanceBetweenPoints, encodeStats, energyPercent, energy_stats, entityDisplayName, entityRecipes, estimateDealTravelTime, estimateTravelTime, findNearbyPlanets, formatModuleLine, gatherer_stats, getAllCraftableItems, getCapabilityAttributes, getCategoryInfo, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEntitySlotLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getLocationTypeName, getModuleCapabilityType, getModuleRecipe, getModuleRecipeByItemId, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isModuleItem, isRelatedItem, itemCategory, itemIcons, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleRecipes, movement_stats, needsRecharge, projectEntity, projectEntityAt, readCommonBase, removeFromStacks, resolveItem, resolveStats, rollTier, rollWithinTier, rotation, schedule, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, toLocation, validateSchedule, warehouse_row };
|