@shipload/sdk 2.0.0-rc13 → 2.0.0-rc14
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 +133 -56
- package/lib/shipload.js +629 -332
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +619 -331
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/modules.ts +3 -3
- package/src/capabilities/storage.ts +6 -9
- package/src/contracts/server.ts +37 -34
- package/src/data/colors.ts +19 -1
- package/src/data/recipes.ts +3 -3
- package/src/derivation/crafting.ts +46 -32
- package/src/derivation/stratum.ts +12 -0
- package/src/entities/container.ts +1 -0
- package/src/entities/makers.ts +126 -11
- package/src/entities/ship-deploy.ts +9 -14
- package/src/entities/ship.ts +16 -4
- package/src/entities/warehouse.ts +36 -1
- package/src/index-module.ts +21 -4
- package/src/managers/actions.ts +48 -8
- package/src/nft/description.ts +31 -30
- package/src/nft/deserializers.ts +8 -8
- package/src/resolution/describe-module.ts +165 -0
- package/src/resolution/resolve-item.ts +60 -37
- package/src/scheduling/projection.ts +3 -1
- package/src/types/capabilities.ts +5 -0
package/lib/shipload.d.ts
CHANGED
|
@@ -174,18 +174,18 @@ declare namespace Types {
|
|
|
174
174
|
reveal: string;
|
|
175
175
|
commit: Checksum256;
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class packed_module extends Struct {
|
|
178
178
|
item_id: UInt16;
|
|
179
|
-
|
|
179
|
+
stats: UInt64;
|
|
180
180
|
}
|
|
181
181
|
class module_entry extends Struct {
|
|
182
182
|
type: UInt8;
|
|
183
|
-
installed?:
|
|
183
|
+
installed?: packed_module;
|
|
184
184
|
}
|
|
185
185
|
class cargo_item extends Struct {
|
|
186
186
|
item_id: UInt16;
|
|
187
187
|
quantity: UInt32;
|
|
188
|
-
|
|
188
|
+
stats: UInt64;
|
|
189
189
|
modules: module_entry[];
|
|
190
190
|
}
|
|
191
191
|
class blend extends Struct {
|
|
@@ -215,7 +215,7 @@ declare namespace Types {
|
|
|
215
215
|
entity_id: UInt64;
|
|
216
216
|
item_id: UInt64;
|
|
217
217
|
quantity: UInt64;
|
|
218
|
-
|
|
218
|
+
stats: UInt64;
|
|
219
219
|
modules: module_entry[];
|
|
220
220
|
}
|
|
221
221
|
class cleanrsvp extends Struct {
|
|
@@ -303,14 +303,14 @@ declare namespace Types {
|
|
|
303
303
|
entity_type: Name;
|
|
304
304
|
id: UInt64;
|
|
305
305
|
packed_item_id: UInt16;
|
|
306
|
-
|
|
306
|
+
stats: UInt64;
|
|
307
307
|
entity_name: string;
|
|
308
308
|
}
|
|
309
309
|
class descentity extends Struct {
|
|
310
310
|
item_id: UInt16;
|
|
311
|
-
|
|
311
|
+
hull_stats: UInt64;
|
|
312
312
|
module_items: UInt16[];
|
|
313
|
-
|
|
313
|
+
module_stats: UInt64[];
|
|
314
314
|
}
|
|
315
315
|
class enable extends Struct {
|
|
316
316
|
enabled: boolean;
|
|
@@ -393,8 +393,8 @@ declare namespace Types {
|
|
|
393
393
|
participants: entity_ref[];
|
|
394
394
|
}
|
|
395
395
|
class gather extends Struct {
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
source: entity_ref;
|
|
397
|
+
destination: entity_ref;
|
|
398
398
|
stratum: UInt16;
|
|
399
399
|
quantity: UInt32;
|
|
400
400
|
}
|
|
@@ -666,7 +666,7 @@ declare namespace Types {
|
|
|
666
666
|
id: UInt64;
|
|
667
667
|
owner: Name;
|
|
668
668
|
name: string;
|
|
669
|
-
|
|
669
|
+
stats: UInt64;
|
|
670
670
|
coordinates: coordinates;
|
|
671
671
|
hullmass?: UInt32;
|
|
672
672
|
capacity?: UInt32;
|
|
@@ -690,14 +690,14 @@ declare namespace Types {
|
|
|
690
690
|
class spawnpacked extends Struct {
|
|
691
691
|
entity_id: UInt64;
|
|
692
692
|
item_id: UInt16;
|
|
693
|
-
|
|
694
|
-
installed:
|
|
693
|
+
hull_stats: UInt64;
|
|
694
|
+
installed: packed_module[];
|
|
695
695
|
}
|
|
696
696
|
class spawnseeded extends Struct {
|
|
697
697
|
entity_id: UInt64;
|
|
698
698
|
item_id: UInt64;
|
|
699
699
|
quantity: UInt64;
|
|
700
|
-
|
|
700
|
+
stats: UInt64;
|
|
701
701
|
}
|
|
702
702
|
class state_row extends Struct {
|
|
703
703
|
enabled: boolean;
|
|
@@ -726,6 +726,7 @@ declare namespace Types {
|
|
|
726
726
|
dest_type: Name;
|
|
727
727
|
dest_id: UInt64;
|
|
728
728
|
item_id: UInt16;
|
|
729
|
+
stats: UInt64;
|
|
729
730
|
quantity: UInt32;
|
|
730
731
|
}
|
|
731
732
|
class travel extends Struct {
|
|
@@ -744,7 +745,7 @@ declare namespace Types {
|
|
|
744
745
|
id: UInt64;
|
|
745
746
|
owner: Name;
|
|
746
747
|
name: string;
|
|
747
|
-
|
|
748
|
+
stats: UInt64;
|
|
748
749
|
coordinates: coordinates;
|
|
749
750
|
hullmass?: UInt32;
|
|
750
751
|
capacity?: UInt32;
|
|
@@ -808,16 +809,16 @@ declare namespace ActionParams {
|
|
|
808
809
|
interface cargo_item {
|
|
809
810
|
item_id: UInt16Type;
|
|
810
811
|
quantity: UInt32Type;
|
|
811
|
-
|
|
812
|
+
stats: UInt64Type;
|
|
812
813
|
modules: Type.module_entry[];
|
|
813
814
|
}
|
|
814
815
|
interface module_entry {
|
|
815
816
|
type: UInt8Type;
|
|
816
|
-
installed?: Type.
|
|
817
|
+
installed?: Type.packed_module;
|
|
817
818
|
}
|
|
818
|
-
interface
|
|
819
|
+
interface packed_module {
|
|
819
820
|
item_id: UInt16Type;
|
|
820
|
-
|
|
821
|
+
stats: UInt64Type;
|
|
821
822
|
}
|
|
822
823
|
interface game_config {
|
|
823
824
|
version: UInt32Type;
|
|
@@ -928,21 +929,21 @@ declare namespace ActionParams {
|
|
|
928
929
|
entity_type: NameType;
|
|
929
930
|
id: UInt64Type;
|
|
930
931
|
packed_item_id: UInt16Type;
|
|
931
|
-
|
|
932
|
+
stats: UInt64Type;
|
|
932
933
|
entity_name: string;
|
|
933
934
|
}
|
|
934
935
|
interface descentity {
|
|
935
936
|
item_id: UInt16Type;
|
|
936
|
-
|
|
937
|
+
hull_stats: UInt64Type;
|
|
937
938
|
module_items: UInt16Type[];
|
|
938
|
-
|
|
939
|
+
module_stats: UInt64Type[];
|
|
939
940
|
}
|
|
940
941
|
interface enable {
|
|
941
942
|
enabled: boolean;
|
|
942
943
|
}
|
|
943
944
|
interface gather {
|
|
944
|
-
|
|
945
|
-
|
|
945
|
+
source: Type.entity_ref;
|
|
946
|
+
destination: Type.entity_ref;
|
|
946
947
|
stratum: UInt16Type;
|
|
947
948
|
quantity: UInt32Type;
|
|
948
949
|
}
|
|
@@ -1053,14 +1054,14 @@ declare namespace ActionParams {
|
|
|
1053
1054
|
interface spawnpacked {
|
|
1054
1055
|
entity_id: UInt64Type;
|
|
1055
1056
|
item_id: UInt16Type;
|
|
1056
|
-
|
|
1057
|
-
installed: Type.
|
|
1057
|
+
hull_stats: UInt64Type;
|
|
1058
|
+
installed: Type.packed_module[];
|
|
1058
1059
|
}
|
|
1059
1060
|
interface spawnseeded {
|
|
1060
1061
|
entity_id: UInt64Type;
|
|
1061
1062
|
item_id: UInt64Type;
|
|
1062
1063
|
quantity: UInt64Type;
|
|
1063
|
-
|
|
1064
|
+
stats: UInt64Type;
|
|
1064
1065
|
}
|
|
1065
1066
|
interface transfer {
|
|
1066
1067
|
source_type: NameType;
|
|
@@ -1068,6 +1069,7 @@ declare namespace ActionParams {
|
|
|
1068
1069
|
dest_type: NameType;
|
|
1069
1070
|
dest_id: UInt64Type;
|
|
1070
1071
|
item_id: UInt16Type;
|
|
1072
|
+
stats: UInt64Type;
|
|
1071
1073
|
quantity: UInt32Type;
|
|
1072
1074
|
}
|
|
1073
1075
|
interface travel {
|
|
@@ -1475,16 +1477,17 @@ declare class ActionsManager extends BaseManager {
|
|
|
1475
1477
|
resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1476
1478
|
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1477
1479
|
recharge(shipId: UInt64Type): Action;
|
|
1478
|
-
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type,
|
|
1480
|
+
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, itemId: UInt64Type, stats: UInt64Type, quantity: UInt64Type): Action;
|
|
1479
1481
|
foundCompany(account: NameType, name: string): Action;
|
|
1480
1482
|
join(account: NameType): Action;
|
|
1481
|
-
gather(
|
|
1483
|
+
gather(source: EntityRefInput, destination: EntityRefInput, stratum: UInt16Type, quantity: UInt32Type): Action;
|
|
1482
1484
|
warp(shipId: UInt64Type, destination: CoordinatesType): Action;
|
|
1483
1485
|
craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
1484
1486
|
blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
1485
|
-
deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number,
|
|
1487
|
+
deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, stats: bigint, entityName: string): Action;
|
|
1486
1488
|
addmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, moduleCargoId: UInt64Type, targetCargoId?: UInt64Type): Action;
|
|
1487
1489
|
rmmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, targetCargoId?: UInt64Type): Action;
|
|
1490
|
+
wrap(owner: NameType, entityType: EntityTypeName, entityId: UInt64Type, cargoId: UInt64Type, quantity: UInt64Type): Action;
|
|
1488
1491
|
joinGame(account: NameType, companyName: string): Action[];
|
|
1489
1492
|
}
|
|
1490
1493
|
|
|
@@ -1553,6 +1556,7 @@ interface EntityCapabilities {
|
|
|
1553
1556
|
loaders?: Types.loader_stats;
|
|
1554
1557
|
gatherer?: Types.gatherer_stats;
|
|
1555
1558
|
crafter?: Types.crafter_stats;
|
|
1559
|
+
hauler?: Types.hauler_stats;
|
|
1556
1560
|
}
|
|
1557
1561
|
interface EntityState {
|
|
1558
1562
|
owner: Name;
|
|
@@ -1566,6 +1570,7 @@ declare function capsHasStorage(caps: EntityCapabilities): boolean;
|
|
|
1566
1570
|
declare function capsHasLoaders(caps: EntityCapabilities): boolean;
|
|
1567
1571
|
declare function capsHasGatherer(caps: EntityCapabilities): boolean;
|
|
1568
1572
|
declare function capsHasMass(caps: EntityCapabilities): boolean;
|
|
1573
|
+
declare function capsHasHauler(caps: EntityCapabilities): boolean;
|
|
1569
1574
|
|
|
1570
1575
|
interface HasCargo {
|
|
1571
1576
|
cargo: Types.cargo_item[];
|
|
@@ -1593,7 +1598,7 @@ declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): bo
|
|
|
1593
1598
|
interface CargoStack {
|
|
1594
1599
|
item_id: UInt16;
|
|
1595
1600
|
quantity: UInt32;
|
|
1596
|
-
|
|
1601
|
+
stats: UInt64;
|
|
1597
1602
|
modules: Types.module_entry[];
|
|
1598
1603
|
}
|
|
1599
1604
|
declare function cargoItemToStack(item: Types.cargo_item): CargoStack;
|
|
@@ -1809,6 +1814,10 @@ declare class InventoryAccessor {
|
|
|
1809
1814
|
}
|
|
1810
1815
|
declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
|
|
1811
1816
|
|
|
1817
|
+
interface PackedModuleInput {
|
|
1818
|
+
itemId: UInt16Type;
|
|
1819
|
+
stats: UInt64Type;
|
|
1820
|
+
}
|
|
1812
1821
|
interface ShipStateInput {
|
|
1813
1822
|
id: UInt64Type;
|
|
1814
1823
|
owner: string;
|
|
@@ -1821,16 +1830,17 @@ interface ShipStateInput {
|
|
|
1821
1830
|
hullmass?: number;
|
|
1822
1831
|
capacity?: number;
|
|
1823
1832
|
energy?: number;
|
|
1824
|
-
|
|
1825
|
-
generator?: Types.energy_stats;
|
|
1826
|
-
loaders?: Types.loader_stats;
|
|
1833
|
+
modules?: PackedModuleInput[];
|
|
1827
1834
|
schedule?: Types.schedule;
|
|
1828
1835
|
cargo?: Types.cargo_item[];
|
|
1829
1836
|
}
|
|
1830
1837
|
declare class Ship extends Types.entity_info {
|
|
1831
1838
|
private _sched?;
|
|
1832
1839
|
private _inv?;
|
|
1840
|
+
private _modules;
|
|
1833
1841
|
get name(): string;
|
|
1842
|
+
get modules(): Types.module_entry[];
|
|
1843
|
+
setModules(modules: Types.module_entry[]): void;
|
|
1834
1844
|
get inv(): InventoryAccessor;
|
|
1835
1845
|
get inventory(): EntityInventory[];
|
|
1836
1846
|
get sched(): ScheduleAccessor;
|
|
@@ -1877,14 +1887,17 @@ interface WarehouseStateInput {
|
|
|
1877
1887
|
};
|
|
1878
1888
|
hullmass?: number;
|
|
1879
1889
|
capacity: number;
|
|
1880
|
-
|
|
1890
|
+
modules?: PackedModuleInput[];
|
|
1881
1891
|
schedule?: Types.schedule;
|
|
1882
1892
|
cargo?: Types.cargo_item[];
|
|
1883
1893
|
}
|
|
1884
1894
|
declare class Warehouse extends Types.entity_info {
|
|
1885
1895
|
private _sched?;
|
|
1886
1896
|
private _inv?;
|
|
1897
|
+
private _modules;
|
|
1887
1898
|
get name(): string;
|
|
1899
|
+
get modules(): Types.module_entry[];
|
|
1900
|
+
setModules(modules: Types.module_entry[]): void;
|
|
1888
1901
|
get inv(): InventoryAccessor;
|
|
1889
1902
|
get inventory(): EntityInventory[];
|
|
1890
1903
|
get sched(): ScheduleAccessor;
|
|
@@ -1901,6 +1914,16 @@ declare class Warehouse extends Types.entity_info {
|
|
|
1901
1914
|
get orbitalAltitude(): number;
|
|
1902
1915
|
get totalMass(): UInt64;
|
|
1903
1916
|
}
|
|
1917
|
+
declare function computeWarehouseCapabilities(modules: {
|
|
1918
|
+
itemId: number;
|
|
1919
|
+
stats: bigint;
|
|
1920
|
+
}[]): {
|
|
1921
|
+
loaders?: {
|
|
1922
|
+
mass: number;
|
|
1923
|
+
thrust: number;
|
|
1924
|
+
quantity: number;
|
|
1925
|
+
};
|
|
1926
|
+
};
|
|
1904
1927
|
|
|
1905
1928
|
interface ContainerStateInput {
|
|
1906
1929
|
id: UInt64Type;
|
|
@@ -1914,6 +1937,7 @@ interface ContainerStateInput {
|
|
|
1914
1937
|
hullmass: number;
|
|
1915
1938
|
capacity: number;
|
|
1916
1939
|
cargomass?: number;
|
|
1940
|
+
cargo?: Types.cargo_item[];
|
|
1917
1941
|
schedule?: Types.schedule;
|
|
1918
1942
|
}
|
|
1919
1943
|
declare class Container extends Types.entity_info {
|
|
@@ -2012,6 +2036,18 @@ interface ResourceStats {
|
|
|
2012
2036
|
stat3: number;
|
|
2013
2037
|
}
|
|
2014
2038
|
declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
|
|
2039
|
+
/**
|
|
2040
|
+
* Derives the three stat values for a raw resource from a deposit's
|
|
2041
|
+
* entropy seed (hash-based, weibull-transformed).
|
|
2042
|
+
*
|
|
2043
|
+
* **Use only on deposit seeds** — the bigint returned by `deriveStratum`
|
|
2044
|
+
* or carried on a `MassDeposit`. Do NOT call this on a cargo item's
|
|
2045
|
+
* `stats` field; cargo stats are bit-packed and must be read via
|
|
2046
|
+
* `decodeStat` (or `decodeStackStats` for category-mapped output).
|
|
2047
|
+
*
|
|
2048
|
+
* Passing a cargo `stats` value here produces meaningless output
|
|
2049
|
+
* (hash of the packed bits, unrelated to the actual stats).
|
|
2050
|
+
*/
|
|
2015
2051
|
declare function deriveResourceStats(seed: bigint): ResourceStats;
|
|
2016
2052
|
|
|
2017
2053
|
declare function deriveLocationSize(loc: Types.location_static): number;
|
|
@@ -2073,9 +2109,9 @@ interface CategoryStacks {
|
|
|
2073
2109
|
stacks: StackInput[];
|
|
2074
2110
|
}
|
|
2075
2111
|
declare function encodeStats(values: number[]): bigint;
|
|
2076
|
-
declare function decodeStat(
|
|
2077
|
-
declare function decodeStats(
|
|
2078
|
-
declare function decodeCraftedItemStats(itemId: number,
|
|
2112
|
+
declare function decodeStat(stats: bigint, index: number): number;
|
|
2113
|
+
declare function decodeStats(stats: bigint, count: number): number[];
|
|
2114
|
+
declare function decodeCraftedItemStats(itemId: number, stats: bigint): Record<string, number>;
|
|
2079
2115
|
declare function blendStacks(stacks: StackInput[], statKey: string): number;
|
|
2080
2116
|
declare function computeComponentStats(componentId: number, categoryStacks: CategoryStacks[]): {
|
|
2081
2117
|
key: string;
|
|
@@ -2100,17 +2136,28 @@ declare function blendCrossGroup(sources: {
|
|
|
2100
2136
|
}[]): number;
|
|
2101
2137
|
declare function blendCargoStacks(itemId: number, stacks: {
|
|
2102
2138
|
quantity: number;
|
|
2103
|
-
|
|
2139
|
+
stats: UInt64;
|
|
2104
2140
|
}[]): UInt64;
|
|
2105
2141
|
interface RecipeSlotInput {
|
|
2106
2142
|
itemId: number;
|
|
2107
2143
|
category: ResourceCategory | undefined;
|
|
2108
2144
|
stacks: {
|
|
2109
2145
|
quantity: number;
|
|
2110
|
-
|
|
2146
|
+
stats: bigint;
|
|
2111
2147
|
}[];
|
|
2112
2148
|
}
|
|
2113
|
-
declare function
|
|
2149
|
+
declare function computeCraftedOutputStats(outputItemId: number, slotInputs: RecipeSlotInput[]): UInt64;
|
|
2150
|
+
/**
|
|
2151
|
+
* Mirrors the contract's gather-time transform. Takes a deposit's entropy
|
|
2152
|
+
* seed (bigint from deriveStratum), derives stats via weibull hashing, and
|
|
2153
|
+
* returns a UInt64 whose bit-packed form matches what the contract writes
|
|
2154
|
+
* to cargo_item.stats on gather.
|
|
2155
|
+
*
|
|
2156
|
+
* Use this whenever off-chain code simulates a gather (testmap, player
|
|
2157
|
+
* scanners that project cargo outcomes) and needs a value that matches
|
|
2158
|
+
* what on-chain cargo would carry.
|
|
2159
|
+
*/
|
|
2160
|
+
declare function encodeGatheredCargoStats(depositSeed: bigint): UInt64;
|
|
2114
2161
|
|
|
2115
2162
|
declare function hash(seed: Checksum256Type, string: string): Checksum256;
|
|
2116
2163
|
declare function hash512(seed: Checksum256Type, string: string): Checksum512;
|
|
@@ -2287,13 +2334,13 @@ declare const MODULE_CRAFTER = 6;
|
|
|
2287
2334
|
declare const MODULE_LAUNCHER = 7;
|
|
2288
2335
|
declare const MODULE_STORAGE = 8;
|
|
2289
2336
|
declare const MODULE_HAULER = 9;
|
|
2290
|
-
interface
|
|
2337
|
+
interface PackedModule {
|
|
2291
2338
|
itemId: number;
|
|
2292
|
-
|
|
2339
|
+
stats: bigint;
|
|
2293
2340
|
}
|
|
2294
2341
|
interface ModuleEntry {
|
|
2295
2342
|
type: number;
|
|
2296
|
-
installed?:
|
|
2343
|
+
installed?: PackedModule;
|
|
2297
2344
|
}
|
|
2298
2345
|
declare function moduleAccepts(slotType: number, moduleType: number): boolean;
|
|
2299
2346
|
declare function getModuleCapabilityType(itemId: number): number;
|
|
@@ -2304,10 +2351,13 @@ declare function computeHaulerDrain(distance: number, drain: number, haulCount:
|
|
|
2304
2351
|
|
|
2305
2352
|
declare const categoryColors: Record<ResourceCategory, string>;
|
|
2306
2353
|
declare const tierColors: Record<ResourceTier, string>;
|
|
2354
|
+
declare const tierLabels: Record<ResourceTier, string>;
|
|
2307
2355
|
declare const categoryIcons: Record<ResourceCategory, string>;
|
|
2356
|
+
type CategoryIconShape = 'hex' | 'diamond' | 'star' | 'circle' | 'square';
|
|
2357
|
+
declare const categoryIconShapes: Record<ResourceCategory, CategoryIconShape>;
|
|
2308
2358
|
declare const componentIcon = "\u25A3";
|
|
2309
2359
|
declare const moduleIcon = "\u2B22";
|
|
2310
|
-
declare const
|
|
2360
|
+
declare const itemAbbreviations: Record<number, string>;
|
|
2311
2361
|
|
|
2312
2362
|
type CraftedItemCategory = 'component' | 'module' | 'entity' | 'resource';
|
|
2313
2363
|
declare const ITEM_TYPE_RESOURCE = 0;
|
|
@@ -2521,7 +2571,7 @@ interface ShipCapabilities {
|
|
|
2521
2571
|
}
|
|
2522
2572
|
declare function computeShipCapabilities(modules: {
|
|
2523
2573
|
itemId: number;
|
|
2524
|
-
|
|
2574
|
+
stats: bigint;
|
|
2525
2575
|
}[]): ShipCapabilities;
|
|
2526
2576
|
|
|
2527
2577
|
interface ResolvedItemStat {
|
|
@@ -2553,6 +2603,7 @@ interface ResolvedItem {
|
|
|
2553
2603
|
itemId: number;
|
|
2554
2604
|
name: string;
|
|
2555
2605
|
icon: string;
|
|
2606
|
+
abbreviation: string | null;
|
|
2556
2607
|
category?: ResourceCategory;
|
|
2557
2608
|
tier: ResourceTier;
|
|
2558
2609
|
mass: number;
|
|
@@ -2561,11 +2612,37 @@ interface ResolvedItem {
|
|
|
2561
2612
|
attributes?: ResolvedAttributeGroup[];
|
|
2562
2613
|
moduleSlots?: ResolvedModuleSlot[];
|
|
2563
2614
|
}
|
|
2564
|
-
declare function resolveItem(itemId: UInt16Type,
|
|
2615
|
+
declare function resolveItem(itemId: UInt16Type, stats?: UInt64Type, modules?: Types.module_entry[]): ResolvedItem;
|
|
2616
|
+
|
|
2617
|
+
interface TextSpan {
|
|
2618
|
+
text: string;
|
|
2619
|
+
highlight?: boolean;
|
|
2620
|
+
}
|
|
2621
|
+
interface CapabilityInput {
|
|
2622
|
+
capability: string;
|
|
2623
|
+
attributes: {
|
|
2624
|
+
label: string;
|
|
2625
|
+
value: number;
|
|
2626
|
+
}[];
|
|
2627
|
+
}
|
|
2628
|
+
interface ModuleDescription {
|
|
2629
|
+
id: string;
|
|
2630
|
+
template: string;
|
|
2631
|
+
params: Readonly<Record<string, number | string>>;
|
|
2632
|
+
highlightKeys: readonly string[];
|
|
2633
|
+
}
|
|
2634
|
+
interface RenderDescriptionOptions {
|
|
2635
|
+
translate?: (id: string, fallback: string) => string;
|
|
2636
|
+
formatNumber?: (n: number) => string;
|
|
2637
|
+
}
|
|
2638
|
+
declare function describeModule(input: CapabilityInput): ModuleDescription | null;
|
|
2639
|
+
declare function describeModuleForItem(resolved: ResolvedItem): ModuleDescription | null;
|
|
2640
|
+
declare function describeModuleForSlot(slot: ResolvedModuleSlot): ModuleDescription | null;
|
|
2641
|
+
declare function renderDescription(desc: ModuleDescription, options?: RenderDescriptionOptions): TextSpan[];
|
|
2565
2642
|
|
|
2566
2643
|
interface NFTInstalledModule {
|
|
2567
2644
|
item_id: number;
|
|
2568
|
-
|
|
2645
|
+
stats: string;
|
|
2569
2646
|
}
|
|
2570
2647
|
interface NFTModuleSlot {
|
|
2571
2648
|
type: number;
|
|
@@ -2574,12 +2651,12 @@ interface NFTModuleSlot {
|
|
|
2574
2651
|
interface NFTCargoItem {
|
|
2575
2652
|
item_id: number;
|
|
2576
2653
|
quantity: number;
|
|
2577
|
-
|
|
2654
|
+
stats: string;
|
|
2578
2655
|
modules?: NFTModuleSlot[];
|
|
2579
2656
|
}
|
|
2580
2657
|
interface NFTCommonBase {
|
|
2581
2658
|
quantity: number;
|
|
2582
|
-
|
|
2659
|
+
stats: string;
|
|
2583
2660
|
origin_x: string;
|
|
2584
2661
|
origin_y: string;
|
|
2585
2662
|
}
|
|
@@ -2591,9 +2668,9 @@ declare const deserializeModule: typeof deserializeScalar;
|
|
|
2591
2668
|
declare function deserializeEntity(data: Record<string, any>, itemId: number): NFTCargoItem;
|
|
2592
2669
|
declare function deserializeAsset(data: Record<string, any>, itemId: number): NFTCargoItem;
|
|
2593
2670
|
|
|
2594
|
-
declare function computeBaseHullmass(
|
|
2595
|
-
declare function computeBaseCapacityShip(
|
|
2596
|
-
declare function computeBaseCapacityWarehouse(
|
|
2671
|
+
declare function computeBaseHullmass(stats: bigint): number;
|
|
2672
|
+
declare function computeBaseCapacityShip(stats: bigint): number;
|
|
2673
|
+
declare function computeBaseCapacityWarehouse(stats: bigint): number;
|
|
2597
2674
|
declare const computeEngineThrust: (vol: number) => number;
|
|
2598
2675
|
declare const computeEngineDrain: (thm: number) => number;
|
|
2599
2676
|
declare const computeGeneratorCap: (res: number) => number;
|
|
@@ -2608,8 +2685,8 @@ declare const computeCrafterSpeed: (rea: number) => number;
|
|
|
2608
2685
|
declare const computeCrafterDrain: (clr: number) => number;
|
|
2609
2686
|
declare function entityDisplayName(itemId: number): string;
|
|
2610
2687
|
declare function moduleDisplayName(itemId: number): string;
|
|
2611
|
-
declare function formatModuleLine(slot: number, itemId: number,
|
|
2612
|
-
declare function buildEntityDescription(itemId: number,
|
|
2688
|
+
declare function formatModuleLine(slot: number, itemId: number, stats: bigint): string;
|
|
2689
|
+
declare function buildEntityDescription(itemId: number, hullStats: bigint, moduleItems: number[], moduleStats: bigint[]): string;
|
|
2613
2690
|
|
|
2614
2691
|
type index_NFTInstalledModule = NFTInstalledModule;
|
|
2615
2692
|
type index_NFTModuleSlot = NFTModuleSlot;
|
|
@@ -2689,4 +2766,4 @@ type location_epoch = Types.location_epoch;
|
|
|
2689
2766
|
type location_derived = Types.location_derived;
|
|
2690
2767
|
type location_row = Types.location_row;
|
|
2691
2768
|
|
|
2692
|
-
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,
|
|
2769
|
+
export { ActionsManager, AnyEntity, BASE_ORBITAL_MASS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, 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, ModuleDescription, 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, PackedModule, PackedModuleInput, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RecipeInput, RecipeSlotInput, RenderDescriptionOptions, 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, TextSpan, 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, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryIconShapes, categoryIcons, categoryItemMass, componentIcon, components, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, 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, computeWarehouseCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, distanceBetweenCoordinates, distanceBetweenPoints, encodeGatheredCargoStats, 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, itemAbbreviations, itemCategory, 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, renderDescription, resolveItem, resolveStats, rollTier, rollWithinTier, rotation, schedule, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, tierLabels, toLocation, validateSchedule, warehouse_row };
|