@shipload/sdk 2.0.0-rc4 → 2.0.0-rc6
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 +411 -1025
- package/lib/shipload.js +879 -2057
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +852 -2028
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/crafting.ts +10 -0
- package/src/capabilities/guards.ts +0 -5
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/storage.ts +0 -8
- package/src/contracts/server.ts +106 -225
- package/src/data/items.json +15 -14
- package/src/data/recipes.ts +129 -0
- package/src/derivation/crafting.ts +120 -0
- package/src/derivation/index.ts +9 -6
- package/src/derivation/resources.ts +54 -53
- package/src/derivation/stats.ts +146 -0
- package/src/derivation/stratum.ts +14 -14
- package/src/entities/cargo-utils.ts +6 -64
- package/src/entities/container.ts +18 -0
- package/src/entities/entity-inventory.ts +0 -4
- package/src/entities/inventory-accessor.ts +0 -4
- package/src/entities/location.ts +2 -197
- package/src/entities/player.ts +1 -274
- package/src/entities/ship.ts +0 -21
- package/src/entities/warehouse.ts +0 -4
- package/src/index-module.ts +43 -47
- package/src/managers/actions.ts +38 -90
- package/src/managers/context.ts +0 -9
- package/src/managers/index.ts +0 -1
- package/src/managers/locations.ts +2 -85
- package/src/market/items.ts +1 -2
- package/src/scheduling/projection.ts +0 -10
- package/src/shipload.ts +0 -5
- package/src/types/capabilities.ts +1 -9
- package/src/types/entity-traits.ts +3 -4
- package/src/types/entity.ts +0 -1
- package/src/types.ts +8 -28
- package/src/utils/system.ts +5 -4
- package/src/managers/trades.ts +0 -119
- package/src/market/market.ts +0 -208
- package/src/market/rolls.ts +0 -8
- package/src/trading/collect.ts +0 -938
- package/src/trading/deal.ts +0 -207
- package/src/trading/trade.ts +0 -203
package/lib/shipload.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _wharfkit_antelope from '@wharfkit/antelope';
|
|
2
|
-
import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action,
|
|
2
|
+
import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt8, TimePoint, UInt16, Int64, UInt16Type, UInt8Type, TimePointType, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
|
|
3
3
|
import * as _wharfkit_contract from '@wharfkit/contract';
|
|
4
4
|
import { Contract as Contract$2, PartialBy, ContractArgs, ActionOptions, Table } from '@wharfkit/contract';
|
|
5
5
|
import { ChainDefinition } from '@wharfkit/session';
|
|
@@ -162,26 +162,6 @@ declare namespace Types {
|
|
|
162
162
|
reveal: string;
|
|
163
163
|
commit: Checksum256;
|
|
164
164
|
}
|
|
165
|
-
class buycontainer extends Struct {
|
|
166
|
-
account: Name;
|
|
167
|
-
ship_id: UInt64;
|
|
168
|
-
name: string;
|
|
169
|
-
}
|
|
170
|
-
class buyitems extends Struct {
|
|
171
|
-
entity_type: Name;
|
|
172
|
-
id: UInt64;
|
|
173
|
-
item_id: UInt16;
|
|
174
|
-
quantity: UInt32;
|
|
175
|
-
}
|
|
176
|
-
class buyship extends Struct {
|
|
177
|
-
account: Name;
|
|
178
|
-
name: string;
|
|
179
|
-
}
|
|
180
|
-
class buywarehouse extends Struct {
|
|
181
|
-
account: Name;
|
|
182
|
-
ship_id: UInt64;
|
|
183
|
-
name: string;
|
|
184
|
-
}
|
|
185
165
|
class cancel extends Struct {
|
|
186
166
|
entity_type: Name;
|
|
187
167
|
id: UInt64;
|
|
@@ -202,7 +182,6 @@ declare namespace Types {
|
|
|
202
182
|
class cargo_item extends Struct {
|
|
203
183
|
item_id: UInt16;
|
|
204
184
|
quantity: UInt32;
|
|
205
|
-
unit_cost: UInt64;
|
|
206
185
|
seed?: UInt64;
|
|
207
186
|
}
|
|
208
187
|
class cargo_row extends Struct {
|
|
@@ -210,7 +189,6 @@ declare namespace Types {
|
|
|
210
189
|
entity_id: UInt64;
|
|
211
190
|
item_id: UInt64;
|
|
212
191
|
quantity: UInt64;
|
|
213
|
-
unit_cost: UInt64;
|
|
214
192
|
seed: UInt64;
|
|
215
193
|
}
|
|
216
194
|
class cleanrsvp extends Struct {
|
|
@@ -238,9 +216,6 @@ declare namespace Types {
|
|
|
238
216
|
thrust: UInt16;
|
|
239
217
|
quantity: UInt8;
|
|
240
218
|
}
|
|
241
|
-
class trade_stats extends Struct {
|
|
242
|
-
margin: UInt16;
|
|
243
|
-
}
|
|
244
219
|
class extractor_stats extends Struct {
|
|
245
220
|
rate: UInt16;
|
|
246
221
|
drain: UInt16;
|
|
@@ -251,6 +226,10 @@ declare namespace Types {
|
|
|
251
226
|
class warp_stats extends Struct {
|
|
252
227
|
range: UInt32;
|
|
253
228
|
}
|
|
229
|
+
class crafter_stats extends Struct {
|
|
230
|
+
speed: UInt16;
|
|
231
|
+
drain: UInt16;
|
|
232
|
+
}
|
|
254
233
|
class entity_defaults extends Struct {
|
|
255
234
|
ship_hullmass: UInt32;
|
|
256
235
|
ship_capacity: UInt32;
|
|
@@ -259,9 +238,9 @@ declare namespace Types {
|
|
|
259
238
|
ship_engines: movement_stats;
|
|
260
239
|
ship_generator: energy_stats;
|
|
261
240
|
ship_loaders: loader_stats;
|
|
262
|
-
ship_trade: trade_stats;
|
|
263
241
|
ship_extractor: extractor_stats;
|
|
264
242
|
ship_warp: warp_stats;
|
|
243
|
+
ship_crafter: crafter_stats;
|
|
265
244
|
warehouse_capacity: UInt32;
|
|
266
245
|
warehouse_z: UInt16;
|
|
267
246
|
warehouse_loaders: loader_stats;
|
|
@@ -271,7 +250,6 @@ declare namespace Types {
|
|
|
271
250
|
}
|
|
272
251
|
class item_def extends Struct {
|
|
273
252
|
id: UInt16;
|
|
274
|
-
base_price: UInt32;
|
|
275
253
|
mass: UInt32;
|
|
276
254
|
}
|
|
277
255
|
class game_config extends Struct {
|
|
@@ -295,7 +273,6 @@ declare namespace Types {
|
|
|
295
273
|
cargo: cargo_item[];
|
|
296
274
|
entitytarget?: entity_ref;
|
|
297
275
|
entitygroup?: UInt64;
|
|
298
|
-
credits?: Int64;
|
|
299
276
|
energy_cost?: UInt16;
|
|
300
277
|
}
|
|
301
278
|
class schedule extends Struct {
|
|
@@ -312,6 +289,27 @@ declare namespace Types {
|
|
|
312
289
|
cargomass: UInt32;
|
|
313
290
|
schedule?: schedule;
|
|
314
291
|
}
|
|
292
|
+
class craft extends Struct {
|
|
293
|
+
entity_type: Name;
|
|
294
|
+
id: UInt64;
|
|
295
|
+
recipe_id: UInt16;
|
|
296
|
+
quantity: UInt32;
|
|
297
|
+
inputs: cargo_item[];
|
|
298
|
+
}
|
|
299
|
+
class createentity extends Struct {
|
|
300
|
+
owner: Name;
|
|
301
|
+
entity_type: Name;
|
|
302
|
+
entity_name: string;
|
|
303
|
+
x: Int64;
|
|
304
|
+
y: Int64;
|
|
305
|
+
}
|
|
306
|
+
class deploy extends Struct {
|
|
307
|
+
entity_type: Name;
|
|
308
|
+
id: UInt64;
|
|
309
|
+
packed_item_id: UInt16;
|
|
310
|
+
seed: UInt64;
|
|
311
|
+
entity_name: string;
|
|
312
|
+
}
|
|
315
313
|
class enable extends Struct {
|
|
316
314
|
enabled: boolean;
|
|
317
315
|
}
|
|
@@ -335,6 +333,7 @@ declare namespace Types {
|
|
|
335
333
|
capacity?: UInt32;
|
|
336
334
|
extractor?: extractor_stats;
|
|
337
335
|
warp?: warp_stats;
|
|
336
|
+
crafter?: crafter_stats;
|
|
338
337
|
is_idle: boolean;
|
|
339
338
|
current_task?: task;
|
|
340
339
|
current_task_elapsed: UInt32;
|
|
@@ -446,17 +445,9 @@ declare namespace Types {
|
|
|
446
445
|
epoch_props: location_epoch;
|
|
447
446
|
size: UInt16;
|
|
448
447
|
}
|
|
449
|
-
class location_item extends Struct {
|
|
450
|
-
id: UInt16;
|
|
451
|
-
price: UInt32;
|
|
452
|
-
supply: UInt16;
|
|
453
|
-
rarity_multiplier: UInt32;
|
|
454
|
-
location_multiplier: UInt32;
|
|
455
|
-
}
|
|
456
448
|
class location_info extends Struct {
|
|
457
449
|
coords: coordinates;
|
|
458
450
|
is_system: boolean;
|
|
459
|
-
items: location_item[];
|
|
460
451
|
}
|
|
461
452
|
class location_row extends Struct {
|
|
462
453
|
id: UInt64;
|
|
@@ -493,33 +484,16 @@ declare namespace Types {
|
|
|
493
484
|
class notify extends Struct {
|
|
494
485
|
event: task_event;
|
|
495
486
|
}
|
|
496
|
-
class payloan extends Struct {
|
|
497
|
-
account: Name;
|
|
498
|
-
amount: UInt64;
|
|
499
|
-
}
|
|
500
487
|
class player_info extends Struct {
|
|
501
488
|
owner: Name;
|
|
502
489
|
is_player: boolean;
|
|
503
490
|
company_name: string;
|
|
504
|
-
balance: UInt64;
|
|
505
|
-
debt: UInt32;
|
|
506
|
-
networth: Int64;
|
|
507
|
-
available_loan: UInt64;
|
|
508
|
-
next_ship_price: UInt64;
|
|
509
|
-
next_warehouse_price: UInt64;
|
|
510
|
-
next_container_price: UInt64;
|
|
511
491
|
ship_count: UInt64;
|
|
512
492
|
warehouse_count: UInt64;
|
|
513
493
|
container_count: UInt64;
|
|
514
494
|
}
|
|
515
495
|
class player_row extends Struct {
|
|
516
496
|
owner: Name;
|
|
517
|
-
balance: UInt64;
|
|
518
|
-
debt: UInt32;
|
|
519
|
-
networth: Int64;
|
|
520
|
-
}
|
|
521
|
-
class purgesupply extends Struct {
|
|
522
|
-
max_rows?: UInt64;
|
|
523
497
|
}
|
|
524
498
|
class recharge extends Struct {
|
|
525
499
|
entity_type: Name;
|
|
@@ -543,20 +517,13 @@ declare namespace Types {
|
|
|
543
517
|
group_members?: entity_ref[];
|
|
544
518
|
}
|
|
545
519
|
class resource_stats extends Struct {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
resonance: UInt16;
|
|
520
|
+
stat1: UInt16;
|
|
521
|
+
stat2: UInt16;
|
|
522
|
+
stat3: UInt16;
|
|
550
523
|
}
|
|
551
524
|
class salt extends Struct {
|
|
552
525
|
salt: UInt64;
|
|
553
526
|
}
|
|
554
|
-
class sellitems extends Struct {
|
|
555
|
-
entity_type: Name;
|
|
556
|
-
id: UInt64;
|
|
557
|
-
item_id: UInt16;
|
|
558
|
-
quantity: UInt32;
|
|
559
|
-
}
|
|
560
527
|
class sequence_row extends Struct {
|
|
561
528
|
key: Name;
|
|
562
529
|
value: UInt64;
|
|
@@ -573,14 +540,17 @@ declare namespace Types {
|
|
|
573
540
|
engines: movement_stats;
|
|
574
541
|
generator: energy_stats;
|
|
575
542
|
loaders: loader_stats;
|
|
576
|
-
trade?: trade_stats;
|
|
577
543
|
extractor?: extractor_stats;
|
|
578
544
|
warp?: warp_stats;
|
|
545
|
+
crafter?: crafter_stats;
|
|
579
546
|
schedule?: schedule;
|
|
580
547
|
}
|
|
548
|
+
class spawncargo extends Struct {
|
|
549
|
+
entity_id: UInt64;
|
|
550
|
+
item_id: UInt64;
|
|
551
|
+
quantity: UInt64;
|
|
552
|
+
}
|
|
581
553
|
class starter_info extends Struct {
|
|
582
|
-
balance: UInt64;
|
|
583
|
-
debt: UInt64;
|
|
584
554
|
ship: entity_info;
|
|
585
555
|
}
|
|
586
556
|
class state_row extends Struct {
|
|
@@ -601,17 +571,6 @@ declare namespace Types {
|
|
|
601
571
|
stratum: stratum_info;
|
|
602
572
|
stats: resource_stats;
|
|
603
573
|
}
|
|
604
|
-
class supply_row extends Struct {
|
|
605
|
-
id: UInt64;
|
|
606
|
-
coordinates: coordinates;
|
|
607
|
-
epoch: UInt64;
|
|
608
|
-
item_id: UInt16;
|
|
609
|
-
supply: UInt16;
|
|
610
|
-
}
|
|
611
|
-
class takeloan extends Struct {
|
|
612
|
-
account: Name;
|
|
613
|
-
amount: UInt64;
|
|
614
|
-
}
|
|
615
574
|
class task_results extends Struct {
|
|
616
575
|
entities: entity_task_info[];
|
|
617
576
|
}
|
|
@@ -636,14 +595,6 @@ declare namespace Types {
|
|
|
636
595
|
starter_info_type: starter_info;
|
|
637
596
|
game_config_type: game_config;
|
|
638
597
|
}
|
|
639
|
-
class updatecredit extends Struct {
|
|
640
|
-
account: Name;
|
|
641
|
-
amount: Int64;
|
|
642
|
-
}
|
|
643
|
-
class updatedebt extends Struct {
|
|
644
|
-
account: Name;
|
|
645
|
-
amount: Int64;
|
|
646
|
-
}
|
|
647
598
|
class warehouse_row extends Struct {
|
|
648
599
|
id: UInt64;
|
|
649
600
|
owner: Name;
|
|
@@ -675,7 +626,6 @@ declare const TableMap: {
|
|
|
675
626
|
sequence: typeof Types.sequence_row;
|
|
676
627
|
ship: typeof Types.ship_row;
|
|
677
628
|
state: typeof Types.state_row;
|
|
678
|
-
supply: typeof Types.supply_row;
|
|
679
629
|
types: typeof Types.types_row;
|
|
680
630
|
warehouse: typeof Types.warehouse_row;
|
|
681
631
|
};
|
|
@@ -689,7 +639,6 @@ interface TableTypes {
|
|
|
689
639
|
sequence: Types.sequence_row;
|
|
690
640
|
ship: Types.ship_row;
|
|
691
641
|
state: Types.state_row;
|
|
692
|
-
supply: Types.supply_row;
|
|
693
642
|
types: Types.types_row;
|
|
694
643
|
warehouse: Types.warehouse_row;
|
|
695
644
|
}
|
|
@@ -710,9 +659,9 @@ declare namespace ActionParams {
|
|
|
710
659
|
ship_engines: Type.movement_stats;
|
|
711
660
|
ship_generator: Type.energy_stats;
|
|
712
661
|
ship_loaders: Type.loader_stats;
|
|
713
|
-
ship_trade: Type.trade_stats;
|
|
714
662
|
ship_extractor: Type.extractor_stats;
|
|
715
663
|
ship_warp: Type.warp_stats;
|
|
664
|
+
ship_crafter: Type.crafter_stats;
|
|
716
665
|
warehouse_capacity: UInt32Type;
|
|
717
666
|
warehouse_z: UInt16Type;
|
|
718
667
|
warehouse_loaders: Type.loader_stats;
|
|
@@ -733,9 +682,6 @@ declare namespace ActionParams {
|
|
|
733
682
|
thrust: UInt16Type;
|
|
734
683
|
quantity: UInt8Type;
|
|
735
684
|
}
|
|
736
|
-
interface trade_stats {
|
|
737
|
-
margin: UInt16Type;
|
|
738
|
-
}
|
|
739
685
|
interface extractor_stats {
|
|
740
686
|
rate: UInt16Type;
|
|
741
687
|
drain: UInt16Type;
|
|
@@ -746,11 +692,19 @@ declare namespace ActionParams {
|
|
|
746
692
|
interface warp_stats {
|
|
747
693
|
range: UInt32Type;
|
|
748
694
|
}
|
|
695
|
+
interface crafter_stats {
|
|
696
|
+
speed: UInt16Type;
|
|
697
|
+
drain: UInt16Type;
|
|
698
|
+
}
|
|
749
699
|
interface item_def {
|
|
750
700
|
id: UInt16Type;
|
|
751
|
-
base_price: UInt32Type;
|
|
752
701
|
mass: UInt32Type;
|
|
753
702
|
}
|
|
703
|
+
interface cargo_item {
|
|
704
|
+
item_id: UInt16Type;
|
|
705
|
+
quantity: UInt32Type;
|
|
706
|
+
seed?: UInt64Type;
|
|
707
|
+
}
|
|
754
708
|
interface entity_ref {
|
|
755
709
|
entity_type: NameType;
|
|
756
710
|
entity_id: UInt64Type;
|
|
@@ -774,7 +728,6 @@ declare namespace ActionParams {
|
|
|
774
728
|
cargo: Type.cargo_item[];
|
|
775
729
|
entitytarget?: Type.entity_ref;
|
|
776
730
|
entitygroup?: UInt64Type;
|
|
777
|
-
credits?: Int64Type;
|
|
778
731
|
energy_cost?: UInt16Type;
|
|
779
732
|
}
|
|
780
733
|
interface coordinates {
|
|
@@ -782,37 +735,11 @@ declare namespace ActionParams {
|
|
|
782
735
|
y: Int64Type;
|
|
783
736
|
z?: UInt16Type;
|
|
784
737
|
}
|
|
785
|
-
interface cargo_item {
|
|
786
|
-
item_id: UInt16Type;
|
|
787
|
-
quantity: UInt32Type;
|
|
788
|
-
unit_cost: UInt64Type;
|
|
789
|
-
seed?: UInt64Type;
|
|
790
|
-
}
|
|
791
738
|
}
|
|
792
739
|
interface advance {
|
|
793
740
|
reveal: string;
|
|
794
741
|
commit: Checksum256Type;
|
|
795
742
|
}
|
|
796
|
-
interface buycontainer {
|
|
797
|
-
account: NameType;
|
|
798
|
-
ship_id: UInt64Type;
|
|
799
|
-
name: string;
|
|
800
|
-
}
|
|
801
|
-
interface buyitems {
|
|
802
|
-
entity_type: NameType;
|
|
803
|
-
id: UInt64Type;
|
|
804
|
-
item_id: UInt16Type;
|
|
805
|
-
quantity: UInt32Type;
|
|
806
|
-
}
|
|
807
|
-
interface buyship {
|
|
808
|
-
account: NameType;
|
|
809
|
-
name: string;
|
|
810
|
-
}
|
|
811
|
-
interface buywarehouse {
|
|
812
|
-
account: NameType;
|
|
813
|
-
ship_id: UInt64Type;
|
|
814
|
-
name: string;
|
|
815
|
-
}
|
|
816
743
|
interface cancel {
|
|
817
744
|
entity_type: NameType;
|
|
818
745
|
id: UInt64Type;
|
|
@@ -833,6 +760,27 @@ declare namespace ActionParams {
|
|
|
833
760
|
interface configlog {
|
|
834
761
|
config: Type.game_config;
|
|
835
762
|
}
|
|
763
|
+
interface craft {
|
|
764
|
+
entity_type: NameType;
|
|
765
|
+
id: UInt64Type;
|
|
766
|
+
recipe_id: UInt16Type;
|
|
767
|
+
quantity: UInt32Type;
|
|
768
|
+
inputs: Type.cargo_item[];
|
|
769
|
+
}
|
|
770
|
+
interface createentity {
|
|
771
|
+
owner: NameType;
|
|
772
|
+
entity_type: NameType;
|
|
773
|
+
entity_name: string;
|
|
774
|
+
x: Int64Type;
|
|
775
|
+
y: Int64Type;
|
|
776
|
+
}
|
|
777
|
+
interface deploy {
|
|
778
|
+
entity_type: NameType;
|
|
779
|
+
id: UInt64Type;
|
|
780
|
+
packed_item_id: UInt16Type;
|
|
781
|
+
seed: UInt64Type;
|
|
782
|
+
entity_name: string;
|
|
783
|
+
}
|
|
836
784
|
interface enable {
|
|
837
785
|
enabled: boolean;
|
|
838
786
|
}
|
|
@@ -902,13 +850,6 @@ declare namespace ActionParams {
|
|
|
902
850
|
interface notify {
|
|
903
851
|
event: Type.task_event;
|
|
904
852
|
}
|
|
905
|
-
interface payloan {
|
|
906
|
-
account: NameType;
|
|
907
|
-
amount: UInt64Type;
|
|
908
|
-
}
|
|
909
|
-
interface purgesupply {
|
|
910
|
-
max_rows?: UInt64Type;
|
|
911
|
-
}
|
|
912
853
|
interface recharge {
|
|
913
854
|
entity_type: NameType;
|
|
914
855
|
id: UInt64Type;
|
|
@@ -921,15 +862,10 @@ declare namespace ActionParams {
|
|
|
921
862
|
interface salt {
|
|
922
863
|
salt: UInt64Type;
|
|
923
864
|
}
|
|
924
|
-
interface
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
quantity: UInt32Type;
|
|
929
|
-
}
|
|
930
|
-
interface takeloan {
|
|
931
|
-
account: NameType;
|
|
932
|
-
amount: UInt64Type;
|
|
865
|
+
interface spawncargo {
|
|
866
|
+
entity_id: UInt64Type;
|
|
867
|
+
item_id: UInt64Type;
|
|
868
|
+
quantity: UInt64Type;
|
|
933
869
|
}
|
|
934
870
|
interface transfer {
|
|
935
871
|
source_type: NameType;
|
|
@@ -946,14 +882,6 @@ declare namespace ActionParams {
|
|
|
946
882
|
y: Int64Type;
|
|
947
883
|
recharge: boolean;
|
|
948
884
|
}
|
|
949
|
-
interface updatecredit {
|
|
950
|
-
account: NameType;
|
|
951
|
-
amount: Int64Type;
|
|
952
|
-
}
|
|
953
|
-
interface updatedebt {
|
|
954
|
-
account: NameType;
|
|
955
|
-
amount: Int64Type;
|
|
956
|
-
}
|
|
957
885
|
interface warp {
|
|
958
886
|
entity_type: NameType;
|
|
959
887
|
id: UInt64Type;
|
|
@@ -967,15 +895,14 @@ declare namespace ActionParams {
|
|
|
967
895
|
}
|
|
968
896
|
interface ActionNameParams {
|
|
969
897
|
advance: ActionParams.advance;
|
|
970
|
-
buycontainer: ActionParams.buycontainer;
|
|
971
|
-
buyitems: ActionParams.buyitems;
|
|
972
|
-
buyship: ActionParams.buyship;
|
|
973
|
-
buywarehouse: ActionParams.buywarehouse;
|
|
974
898
|
cancel: ActionParams.cancel;
|
|
975
899
|
cleanrsvp: ActionParams.cleanrsvp;
|
|
976
900
|
cleartable: ActionParams.cleartable;
|
|
977
901
|
commit: ActionParams.commit;
|
|
978
902
|
configlog: ActionParams.configlog;
|
|
903
|
+
craft: ActionParams.craft;
|
|
904
|
+
createentity: ActionParams.createentity;
|
|
905
|
+
deploy: ActionParams.deploy;
|
|
979
906
|
enable: ActionParams.enable;
|
|
980
907
|
extract: ActionParams.extract;
|
|
981
908
|
getconfig: ActionParams.getconfig;
|
|
@@ -995,25 +922,21 @@ interface ActionNameParams {
|
|
|
995
922
|
init: ActionParams.init;
|
|
996
923
|
join: ActionParams.join;
|
|
997
924
|
notify: ActionParams.notify;
|
|
998
|
-
payloan: ActionParams.payloan;
|
|
999
|
-
purgesupply: ActionParams.purgesupply;
|
|
1000
925
|
recharge: ActionParams.recharge;
|
|
1001
926
|
resolve: ActionParams.resolve;
|
|
1002
927
|
salt: ActionParams.salt;
|
|
1003
|
-
|
|
1004
|
-
takeloan: ActionParams.takeloan;
|
|
928
|
+
spawncargo: ActionParams.spawncargo;
|
|
1005
929
|
transfer: ActionParams.transfer;
|
|
1006
930
|
travel: ActionParams.travel;
|
|
1007
|
-
updatecredit: ActionParams.updatecredit;
|
|
1008
|
-
updatedebt: ActionParams.updatedebt;
|
|
1009
931
|
warp: ActionParams.warp;
|
|
1010
932
|
wipe: ActionParams.wipe;
|
|
1011
933
|
wipesequence: ActionParams.wipesequence;
|
|
1012
934
|
}
|
|
1013
935
|
type ActionNames = keyof ActionNameParams;
|
|
1014
936
|
interface ActionReturnValues {
|
|
1015
|
-
buyitems: Types.task_results;
|
|
1016
937
|
cancel: Types.cancel_results;
|
|
938
|
+
craft: Types.task_results;
|
|
939
|
+
deploy: Types.task_results;
|
|
1017
940
|
extract: Types.task_results;
|
|
1018
941
|
getconfig: Types.game_config;
|
|
1019
942
|
getentities: Types.entity_info[];
|
|
@@ -1031,7 +954,6 @@ interface ActionReturnValues {
|
|
|
1031
954
|
hash512: Checksum512;
|
|
1032
955
|
recharge: Types.task_results;
|
|
1033
956
|
resolve: Types.resolve_results;
|
|
1034
|
-
sellitems: Types.task_results;
|
|
1035
957
|
transfer: Types.task_results;
|
|
1036
958
|
travel: Types.task_results;
|
|
1037
959
|
warp: Types.task_results;
|
|
@@ -1164,7 +1086,9 @@ declare enum TaskType {
|
|
|
1164
1086
|
LOAD = 3,
|
|
1165
1087
|
UNLOAD = 4,
|
|
1166
1088
|
EXTRACT = 5,
|
|
1167
|
-
WARP = 6
|
|
1089
|
+
WARP = 6,
|
|
1090
|
+
CRAFT = 7,
|
|
1091
|
+
DEPLOY = 8
|
|
1168
1092
|
}
|
|
1169
1093
|
declare enum LocationType {
|
|
1170
1094
|
EMPTY = 0,
|
|
@@ -1198,24 +1122,17 @@ interface Distance {
|
|
|
1198
1122
|
destination: ActionParams.Type.coordinates;
|
|
1199
1123
|
distance: UInt16;
|
|
1200
1124
|
}
|
|
1201
|
-
type ResourceCategory = 'metal' | 'gas' | 'mineral' | 'organic';
|
|
1202
|
-
type
|
|
1125
|
+
type ResourceCategory = 'metal' | 'precious' | 'gas' | 'mineral' | 'organic';
|
|
1126
|
+
type ResourceTier = 't1' | 't2' | 't3' | 't4' | 't5';
|
|
1203
1127
|
declare class Item extends Struct {
|
|
1204
1128
|
id: UInt16;
|
|
1205
1129
|
name: string;
|
|
1206
1130
|
description: string;
|
|
1207
|
-
base_price: UInt32;
|
|
1208
1131
|
mass: UInt32;
|
|
1209
1132
|
category: ResourceCategory;
|
|
1210
|
-
|
|
1133
|
+
tier: ResourceTier;
|
|
1211
1134
|
color: string;
|
|
1212
1135
|
}
|
|
1213
|
-
declare class ItemPrice extends Struct {
|
|
1214
|
-
id: UInt16;
|
|
1215
|
-
item: Item;
|
|
1216
|
-
price: UInt32;
|
|
1217
|
-
supply: UInt16;
|
|
1218
|
-
}
|
|
1219
1136
|
|
|
1220
1137
|
interface EpochInfo {
|
|
1221
1138
|
epoch: UInt64;
|
|
@@ -1303,282 +1220,103 @@ declare class GameState extends Types.state_row {
|
|
|
1303
1220
|
|
|
1304
1221
|
interface PlayerStateInput {
|
|
1305
1222
|
owner: NameType;
|
|
1306
|
-
balance: UInt64Type;
|
|
1307
|
-
debt: UInt32Type;
|
|
1308
|
-
networth: Int64Type;
|
|
1309
1223
|
}
|
|
1310
|
-
/**
|
|
1311
|
-
* Player helper class extending player_row with computed financial properties.
|
|
1312
|
-
* Provides easy access to balance, debt, networth, and loan calculations.
|
|
1313
|
-
*/
|
|
1314
1224
|
declare class Player extends Types.player_row {
|
|
1315
|
-
/**
|
|
1316
|
-
* Construct a Player instance from individual state pieces.
|
|
1317
|
-
* Used by UI's ReactivePlayer to reconstruct Player from reactive state.
|
|
1318
|
-
*/
|
|
1319
1225
|
static fromState(state: PlayerStateInput): Player;
|
|
1320
|
-
private static readonly MAX_LOAN;
|
|
1321
|
-
private static readonly BASE_SHIP_COST;
|
|
1322
|
-
private static readonly SHIP_COST_MULTIPLIER;
|
|
1323
|
-
private _shipCount?;
|
|
1324
|
-
/**
|
|
1325
|
-
* Set the current ship count (needed for nextShipCost calculation)
|
|
1326
|
-
*/
|
|
1327
|
-
setShipCount(count: number): void;
|
|
1328
|
-
/**
|
|
1329
|
-
* Get the current ship count (if set)
|
|
1330
|
-
*/
|
|
1331
|
-
get shipCount(): number | undefined;
|
|
1332
|
-
/**
|
|
1333
|
-
* Calculate the cost of the next ship based on current ship count
|
|
1334
|
-
* Matches contract: pow(5, sequence) * 100
|
|
1335
|
-
* @param shipCount - Optional ship count (uses cached value if not provided)
|
|
1336
|
-
*/
|
|
1337
|
-
getNextShipCost(shipCount?: number): UInt64;
|
|
1338
|
-
/**
|
|
1339
|
-
* Get the cost of the next ship based on cached ship count
|
|
1340
|
-
*/
|
|
1341
|
-
get nextShipCost(): UInt64;
|
|
1342
|
-
/**
|
|
1343
|
-
* Check if player can afford to buy a ship
|
|
1344
|
-
* @param shipCount - Optional ship count (uses cached value if not provided)
|
|
1345
|
-
*/
|
|
1346
|
-
canBuyShip(shipCount?: number): boolean;
|
|
1347
|
-
/**
|
|
1348
|
-
* Calculate available loan amount (max loan - current debt)
|
|
1349
|
-
*/
|
|
1350
|
-
get availableLoan(): UInt64;
|
|
1351
|
-
/**
|
|
1352
|
-
* Check if player can take out a loan
|
|
1353
|
-
*/
|
|
1354
|
-
get canTakeLoan(): boolean;
|
|
1355
|
-
/**
|
|
1356
|
-
* Check if player can pay back loan
|
|
1357
|
-
*/
|
|
1358
|
-
get canPayLoan(): boolean;
|
|
1359
|
-
/**
|
|
1360
|
-
* Calculate maximum payback amount (min of debt and balance)
|
|
1361
|
-
*/
|
|
1362
|
-
get maxPayback(): UInt64;
|
|
1363
|
-
/**
|
|
1364
|
-
* Get the maximum loan amount (constant)
|
|
1365
|
-
*/
|
|
1366
|
-
static get MAX_LOAN_LIMIT(): number;
|
|
1367
|
-
/**
|
|
1368
|
-
* Check if player is in debt
|
|
1369
|
-
*/
|
|
1370
|
-
get hasDebt(): boolean;
|
|
1371
|
-
/**
|
|
1372
|
-
* Check if player is solvent (positive networth)
|
|
1373
|
-
*/
|
|
1374
|
-
get isSolvent(): boolean;
|
|
1375
|
-
/**
|
|
1376
|
-
* Create an optimistic update for balance changes
|
|
1377
|
-
* Uses integer math to match contract
|
|
1378
|
-
* @param delta - Amount to change (can be negative)
|
|
1379
|
-
*/
|
|
1380
|
-
withBalanceChange(delta: UInt64 | number): Player;
|
|
1381
|
-
/**
|
|
1382
|
-
* Create an optimistic update for debt changes
|
|
1383
|
-
* Uses integer math to match contract
|
|
1384
|
-
* @param delta - Amount to change (can be negative)
|
|
1385
|
-
*/
|
|
1386
|
-
withDebtChange(delta: UInt64 | number): Player;
|
|
1387
|
-
/**
|
|
1388
|
-
* Create an optimistic update for taking a loan
|
|
1389
|
-
*/
|
|
1390
|
-
withLoan(amount: UInt64): Player;
|
|
1391
|
-
/**
|
|
1392
|
-
* Create an optimistic update for paying back a loan
|
|
1393
|
-
*/
|
|
1394
|
-
withLoanPayment(amount: UInt64): Player;
|
|
1395
|
-
/**
|
|
1396
|
-
* Simulate networth update from selling goods.
|
|
1397
|
-
* Matches contract: networth += (sellPrice - paid * quantity)
|
|
1398
|
-
* Contract reference: market.cpp:75
|
|
1399
|
-
*
|
|
1400
|
-
* @param sellPrice - Total revenue from sale (price * quantity)
|
|
1401
|
-
* @param paidPerUnit - Average cost per unit paid (from cargo.paid)
|
|
1402
|
-
* @param quantity - Quantity being sold
|
|
1403
|
-
* @returns New player with updated networth
|
|
1404
|
-
*
|
|
1405
|
-
* @example
|
|
1406
|
-
* // Sold 10 units at 150 each (revenue=1500), paid 100 per unit
|
|
1407
|
-
* const newPlayer = player.withSaleNetworth(
|
|
1408
|
-
* UInt64.from(1500),
|
|
1409
|
-
* UInt64.from(100),
|
|
1410
|
-
* UInt32.from(10)
|
|
1411
|
-
* )
|
|
1412
|
-
* // Networth increases by: 1500 - (100*10) = 500
|
|
1413
|
-
*/
|
|
1414
|
-
withSaleNetworth(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
|
|
1415
|
-
/**
|
|
1416
|
-
* Simulate complete sell goods transaction.
|
|
1417
|
-
* Updates both balance (adds revenue) and networth (adds profit).
|
|
1418
|
-
* Matches contract actions: update_balance + update_networth
|
|
1419
|
-
*
|
|
1420
|
-
* @param sellPrice - Total revenue from sale (price * quantity)
|
|
1421
|
-
* @param paidPerUnit - Average cost per unit paid (from cargo.paid)
|
|
1422
|
-
* @param quantity - Quantity being sold
|
|
1423
|
-
* @returns New player with updated balance and networth
|
|
1424
|
-
*/
|
|
1425
|
-
withSellGoods(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
|
|
1426
|
-
/**
|
|
1427
|
-
* Simulate complete buy goods transaction.
|
|
1428
|
-
* Updates balance (subtracts cost).
|
|
1429
|
-
*
|
|
1430
|
-
* @param purchaseCost - Total cost of purchase (price * quantity)
|
|
1431
|
-
* @returns New player with updated balance
|
|
1432
|
-
*/
|
|
1433
|
-
withBuyGoods(purchaseCost: UInt64): Player;
|
|
1434
1226
|
}
|
|
1435
1227
|
|
|
1436
1228
|
declare class PlayersManager extends BaseManager {
|
|
1437
1229
|
getPlayer(account: NameType): Promise<Player | undefined>;
|
|
1438
1230
|
}
|
|
1439
1231
|
|
|
1440
|
-
/**
|
|
1441
|
-
* Location helper class for working with game coordinates.
|
|
1442
|
-
* Provides system detection, market price caching, nearby planet finding, and supply tracking.
|
|
1443
|
-
*/
|
|
1444
|
-
declare class Location {
|
|
1445
|
-
readonly coordinates: Coordinates;
|
|
1446
|
-
private _marketPrices?;
|
|
1447
|
-
private _gameSeed?;
|
|
1448
|
-
private _hasSystem?;
|
|
1449
|
-
private _locationRows?;
|
|
1450
|
-
private _epoch?;
|
|
1451
|
-
constructor(coordinates: CoordinatesType);
|
|
1452
|
-
/**
|
|
1453
|
-
* Create a Location from coordinates
|
|
1454
|
-
*/
|
|
1455
|
-
static from(coordinates: CoordinatesType): Location;
|
|
1456
|
-
/**
|
|
1457
|
-
* Check if this location has a system (planet, asteroid, or nebula)
|
|
1458
|
-
*/
|
|
1459
|
-
hasSystemAt(gameSeed: Checksum256Type): boolean;
|
|
1460
|
-
/**
|
|
1461
|
-
* Get the location type (EMPTY, PLANET, ASTEROID, or NEBULA)
|
|
1462
|
-
*/
|
|
1463
|
-
getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
|
|
1464
|
-
/**
|
|
1465
|
-
* Check if this location is extractable (asteroid or nebula)
|
|
1466
|
-
*/
|
|
1467
|
-
isExtractableAt(gameSeed: Checksum256Type): boolean;
|
|
1468
|
-
/**
|
|
1469
|
-
* Set cached market prices for this location
|
|
1470
|
-
*/
|
|
1471
|
-
setMarketPrices(prices: ItemPrice[]): void;
|
|
1472
|
-
/**
|
|
1473
|
-
* Get cached market prices (returns undefined if not cached)
|
|
1474
|
-
*/
|
|
1475
|
-
get marketPrices(): ItemPrice[] | undefined;
|
|
1476
|
-
/**
|
|
1477
|
-
* Get price for a specific good (from cache)
|
|
1478
|
-
*/
|
|
1479
|
-
getPrice(goodId: UInt16Type): ItemPrice | undefined;
|
|
1480
|
-
/**
|
|
1481
|
-
* Find nearby planets from this location
|
|
1482
|
-
*/
|
|
1483
|
-
findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
|
|
1484
|
-
/**
|
|
1485
|
-
* Check if this location equals another location
|
|
1486
|
-
*/
|
|
1487
|
-
equals(other: CoordinatesType | Location): boolean;
|
|
1488
|
-
/**
|
|
1489
|
-
* Set location rows (supply data) for this location
|
|
1490
|
-
*/
|
|
1491
|
-
setLocationRows(rows: Types.supply_row[], epoch: UInt64): void;
|
|
1492
|
-
/**
|
|
1493
|
-
* Get cached location rows (supply data)
|
|
1494
|
-
*/
|
|
1495
|
-
get locationRows(): Types.supply_row[] | undefined;
|
|
1496
|
-
/**
|
|
1497
|
-
* Get supply for a specific good at this location
|
|
1498
|
-
* Returns undefined if location rows not cached or good not found
|
|
1499
|
-
*/
|
|
1500
|
-
getSupply(goodId: UInt16Type): UInt16 | undefined;
|
|
1501
|
-
/**
|
|
1502
|
-
* Get all available goods at this location (goods with supply > 0)
|
|
1503
|
-
* Returns undefined if location rows not cached
|
|
1504
|
-
*/
|
|
1505
|
-
get availableGoods(): Types.supply_row[] | undefined;
|
|
1506
|
-
/**
|
|
1507
|
-
* Check if a specific good is available (has supply)
|
|
1508
|
-
* Returns false if location rows not cached
|
|
1509
|
-
*/
|
|
1510
|
-
hasGood(goodId: UInt16Type): boolean;
|
|
1511
|
-
/**
|
|
1512
|
-
* Get the epoch for cached location data
|
|
1513
|
-
*/
|
|
1514
|
-
get epoch(): UInt64 | undefined;
|
|
1515
|
-
/**
|
|
1516
|
-
* Check if cached data exists
|
|
1517
|
-
*/
|
|
1518
|
-
get hasCachedData(): boolean;
|
|
1519
|
-
/**
|
|
1520
|
-
* Check if supply data is cached
|
|
1521
|
-
*/
|
|
1522
|
-
get hasSupplyData(): boolean;
|
|
1523
|
-
/**
|
|
1524
|
-
* Clear all cached data
|
|
1525
|
-
*/
|
|
1526
|
-
clearCache(): void;
|
|
1527
|
-
/**
|
|
1528
|
-
* Create optimistic Location with updated supply after purchase/sale.
|
|
1529
|
-
* Matches contract: update_location_supply (delta can be positive or negative)
|
|
1530
|
-
* Contract reference: market.cpp:53, 123-151
|
|
1531
|
-
*
|
|
1532
|
-
* @param goodId - Good ID to update supply for
|
|
1533
|
-
* @param quantityDelta - Change in supply (negative for purchase, positive for sale)
|
|
1534
|
-
* @returns New Location with updated supply in cached data
|
|
1535
|
-
*
|
|
1536
|
-
* @example
|
|
1537
|
-
* // After buying 10 units (supply decreases)
|
|
1538
|
-
* const newLocation = location.withUpdatedSupply(1, -10)
|
|
1539
|
-
*
|
|
1540
|
-
* // After selling 5 units (supply increases)
|
|
1541
|
-
* const newLocation = location.withUpdatedSupply(1, 5)
|
|
1542
|
-
*/
|
|
1543
|
-
withUpdatedSupply(goodId: UInt16Type, quantityDelta: number): Location;
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* Helper function to convert various coordinate types to Location
|
|
1547
|
-
*/
|
|
1548
|
-
declare function toLocation(coords: CoordinatesType | Location): Location;
|
|
1549
|
-
|
|
1550
1232
|
declare class LocationsManager extends BaseManager {
|
|
1551
|
-
getMarketPrice(location: CoordinatesType, goodId: number): Promise<ItemPrice>;
|
|
1552
|
-
getMarketPrices(location: CoordinatesType): Promise<ItemPrice[]>;
|
|
1553
|
-
getMarketPricesWithSupply(location: CoordinatesType): Promise<ItemPrice[]>;
|
|
1554
1233
|
hasSystem(location: CoordinatesType): Promise<boolean>;
|
|
1555
1234
|
findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
|
|
1556
|
-
getSupplyRows(location: CoordinatesType): Promise<any[]>;
|
|
1557
|
-
getLocationWithPrices(coords: CoordinatesType): Promise<Location>;
|
|
1558
|
-
getLocationWithSupply(coords: CoordinatesType): Promise<Location>;
|
|
1559
|
-
getLocationComplete(coords: CoordinatesType): Promise<Location>;
|
|
1560
1235
|
getLocationEntity(id: UInt64Type): Promise<Types.location_row | undefined>;
|
|
1561
1236
|
getLocationEntityAt(coords: CoordinatesType): Promise<Types.location_row | undefined>;
|
|
1562
1237
|
getAllLocationEntities(): Promise<Types.location_row[]>;
|
|
1563
1238
|
}
|
|
1564
1239
|
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
interface StorageCapability {
|
|
1573
|
-
capacity: UInt32;
|
|
1574
|
-
cargomass: UInt32;
|
|
1575
|
-
cargo: Types.cargo_item[];
|
|
1576
|
-
}
|
|
1577
|
-
interface LoaderCapability {
|
|
1578
|
-
loaders: Types.loader_stats;
|
|
1240
|
+
declare class EpochsManager extends BaseManager {
|
|
1241
|
+
getCurrentHeight(): Promise<UInt64>;
|
|
1242
|
+
getCurrent(): Promise<EpochInfo>;
|
|
1243
|
+
getByHeight(height: UInt64Type): Promise<EpochInfo>;
|
|
1244
|
+
getTimeRemaining(): Promise<number>;
|
|
1245
|
+
getProgress(): Promise<number>;
|
|
1246
|
+
fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
|
|
1579
1247
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1248
|
+
|
|
1249
|
+
type EntityRefInput = {
|
|
1250
|
+
entityType: EntityTypeName;
|
|
1251
|
+
entityId: UInt64Type;
|
|
1252
|
+
};
|
|
1253
|
+
declare class ActionsManager extends BaseManager {
|
|
1254
|
+
travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
|
|
1255
|
+
grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
|
|
1256
|
+
resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1257
|
+
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1258
|
+
recharge(shipId: UInt64Type): Action;
|
|
1259
|
+
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
|
|
1260
|
+
foundCompany(account: NameType, name: string): Action;
|
|
1261
|
+
join(account: NameType): Action;
|
|
1262
|
+
extract(shipId: UInt64Type): Action;
|
|
1263
|
+
warp(shipId: UInt64Type, destination: CoordinatesType): Action;
|
|
1264
|
+
craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: {
|
|
1265
|
+
itemId: number;
|
|
1266
|
+
quantity: number;
|
|
1267
|
+
seed?: bigint;
|
|
1268
|
+
}[]): Action;
|
|
1269
|
+
deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, seed: bigint, entityName: string): Action;
|
|
1270
|
+
joinGame(account: NameType, companyName: string): Action[];
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
declare class GameContext {
|
|
1274
|
+
readonly client: APIClient;
|
|
1275
|
+
readonly server: Contract$2;
|
|
1276
|
+
readonly platform: Contract$2;
|
|
1277
|
+
private _entities?;
|
|
1278
|
+
private _players?;
|
|
1279
|
+
private _locations?;
|
|
1280
|
+
private _epochs?;
|
|
1281
|
+
private _actions?;
|
|
1282
|
+
private _gameCache?;
|
|
1283
|
+
private _stateCache?;
|
|
1284
|
+
constructor(client: APIClient, server: Contract$2, platform: Contract$2);
|
|
1285
|
+
get entities(): EntitiesManager;
|
|
1286
|
+
get players(): PlayersManager;
|
|
1287
|
+
get locations(): LocationsManager;
|
|
1288
|
+
get epochs(): EpochsManager;
|
|
1289
|
+
get actions(): ActionsManager;
|
|
1290
|
+
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
1291
|
+
getState(reload?: boolean): Promise<GameState>;
|
|
1292
|
+
get cachedGame(): Types$1.game_row | undefined;
|
|
1293
|
+
get cachedState(): GameState | undefined;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
declare abstract class BaseManager {
|
|
1297
|
+
protected readonly context: GameContext;
|
|
1298
|
+
constructor(context: GameContext);
|
|
1299
|
+
protected get client(): _wharfkit_antelope.APIClient;
|
|
1300
|
+
protected get server(): _wharfkit_contract.Contract;
|
|
1301
|
+
protected get platform(): _wharfkit_contract.Contract;
|
|
1302
|
+
protected getGame(): Promise<Types$1.game_row>;
|
|
1303
|
+
protected getState(): Promise<GameState>;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
interface MovementCapability {
|
|
1307
|
+
engines: Types.movement_stats;
|
|
1308
|
+
generator: Types.energy_stats;
|
|
1309
|
+
}
|
|
1310
|
+
interface EnergyCapability {
|
|
1311
|
+
energy: UInt16;
|
|
1312
|
+
}
|
|
1313
|
+
interface StorageCapability {
|
|
1314
|
+
capacity: UInt32;
|
|
1315
|
+
cargomass: UInt32;
|
|
1316
|
+
cargo: Types.cargo_item[];
|
|
1317
|
+
}
|
|
1318
|
+
interface LoaderCapability {
|
|
1319
|
+
loaders: Types.loader_stats;
|
|
1582
1320
|
}
|
|
1583
1321
|
interface ExtractorCapability {
|
|
1584
1322
|
extractor: Types.extractor_stats;
|
|
@@ -1595,8 +1333,8 @@ interface EntityCapabilities {
|
|
|
1595
1333
|
engines?: Types.movement_stats;
|
|
1596
1334
|
generator?: Types.energy_stats;
|
|
1597
1335
|
loaders?: Types.loader_stats;
|
|
1598
|
-
trade?: Types.trade_stats;
|
|
1599
1336
|
extractor?: Types.extractor_stats;
|
|
1337
|
+
crafter?: Types.crafter_stats;
|
|
1600
1338
|
}
|
|
1601
1339
|
interface EntityState {
|
|
1602
1340
|
owner: Name;
|
|
@@ -1608,7 +1346,6 @@ interface EntityState {
|
|
|
1608
1346
|
declare function capsHasMovement(caps: EntityCapabilities): boolean;
|
|
1609
1347
|
declare function capsHasStorage(caps: EntityCapabilities): boolean;
|
|
1610
1348
|
declare function capsHasLoaders(caps: EntityCapabilities): boolean;
|
|
1611
|
-
declare function capsHasTrade(caps: EntityCapabilities): boolean;
|
|
1612
1349
|
declare function capsHasExtractor(caps: EntityCapabilities): boolean;
|
|
1613
1350
|
declare function capsHasMass(caps: EntityCapabilities): boolean;
|
|
1614
1351
|
|
|
@@ -1723,12 +1460,10 @@ interface ProjectedEntity {
|
|
|
1723
1460
|
engines?: Types.movement_stats;
|
|
1724
1461
|
loaders?: Types.loader_stats;
|
|
1725
1462
|
generator?: Types.energy_stats;
|
|
1726
|
-
trade?: Types.trade_stats;
|
|
1727
1463
|
readonly totalMass: UInt64;
|
|
1728
1464
|
hasMovement(): boolean;
|
|
1729
1465
|
hasStorage(): boolean;
|
|
1730
1466
|
hasLoaders(): boolean;
|
|
1731
|
-
hasTrade(): boolean;
|
|
1732
1467
|
capabilities(): EntityCapabilities;
|
|
1733
1468
|
state(): EntityState;
|
|
1734
1469
|
}
|
|
@@ -1739,7 +1474,6 @@ interface Projectable extends ScheduleData {
|
|
|
1739
1474
|
generator?: Types.energy_stats;
|
|
1740
1475
|
engines?: Types.movement_stats;
|
|
1741
1476
|
loaders?: Types.loader_stats;
|
|
1742
|
-
trade?: Types.trade_stats;
|
|
1743
1477
|
capacity?: UInt32;
|
|
1744
1478
|
cargo: Types.cargo_item[];
|
|
1745
1479
|
cargomass: UInt32;
|
|
@@ -1749,6 +1483,23 @@ declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
|
|
|
1749
1483
|
declare function projectEntity(entity: Projectable): ProjectedEntity;
|
|
1750
1484
|
declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
|
|
1751
1485
|
|
|
1486
|
+
declare class Location {
|
|
1487
|
+
readonly coordinates: Coordinates;
|
|
1488
|
+
private _gameSeed?;
|
|
1489
|
+
private _hasSystem?;
|
|
1490
|
+
private _epoch?;
|
|
1491
|
+
constructor(coordinates: CoordinatesType);
|
|
1492
|
+
static from(coordinates: CoordinatesType): Location;
|
|
1493
|
+
hasSystemAt(gameSeed: Checksum256Type): boolean;
|
|
1494
|
+
getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
|
|
1495
|
+
isExtractableAt(gameSeed: Checksum256Type): boolean;
|
|
1496
|
+
findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
|
|
1497
|
+
equals(other: CoordinatesType | Location): boolean;
|
|
1498
|
+
get epoch(): UInt64 | undefined;
|
|
1499
|
+
clearCache(): void;
|
|
1500
|
+
}
|
|
1501
|
+
declare function toLocation(coords: CoordinatesType | Location): Location;
|
|
1502
|
+
|
|
1752
1503
|
type Task = Types.task;
|
|
1753
1504
|
declare class ScheduleAccessor {
|
|
1754
1505
|
private entity;
|
|
@@ -1780,7 +1531,6 @@ declare class EntityInventory extends Types.cargo_item {
|
|
|
1780
1531
|
get name(): string;
|
|
1781
1532
|
get unitMass(): UInt32;
|
|
1782
1533
|
get totalMass(): UInt64;
|
|
1783
|
-
get totalCost(): UInt64;
|
|
1784
1534
|
get hasCargo(): boolean;
|
|
1785
1535
|
get isEmpty(): boolean;
|
|
1786
1536
|
}
|
|
@@ -1795,7 +1545,6 @@ interface HasCargomass {
|
|
|
1795
1545
|
cargomass: UInt32;
|
|
1796
1546
|
}
|
|
1797
1547
|
declare function calcCargoMass(entity: HasCargo): UInt64;
|
|
1798
|
-
declare function calcCargoValue(entity: HasCargo): UInt64;
|
|
1799
1548
|
declare function availableCapacity$1(entity: StorageCapability): UInt64;
|
|
1800
1549
|
declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
|
|
1801
1550
|
declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
|
|
@@ -1809,7 +1558,6 @@ declare class InventoryAccessor {
|
|
|
1809
1558
|
constructor(entity: HasCargo);
|
|
1810
1559
|
get items(): EntityInventory[];
|
|
1811
1560
|
get totalMass(): UInt64;
|
|
1812
|
-
get totalValue(): UInt64;
|
|
1813
1561
|
forItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
1814
1562
|
get sellable(): EntityInventory[];
|
|
1815
1563
|
get hasSellable(): boolean;
|
|
@@ -1817,57 +1565,6 @@ declare class InventoryAccessor {
|
|
|
1817
1565
|
}
|
|
1818
1566
|
declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
|
|
1819
1567
|
|
|
1820
|
-
interface CargoData {
|
|
1821
|
-
cargo: EntityInventory[];
|
|
1822
|
-
}
|
|
1823
|
-
declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
|
|
1824
|
-
declare function cargoValue(cargo: EntityInventory[]): UInt64;
|
|
1825
|
-
declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
|
|
1826
|
-
declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
|
|
1827
|
-
declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
|
|
1828
|
-
declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
|
|
1829
|
-
interface SaleValue {
|
|
1830
|
-
revenue: UInt64;
|
|
1831
|
-
profit: UInt64;
|
|
1832
|
-
cost: UInt64;
|
|
1833
|
-
}
|
|
1834
|
-
declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
|
|
1835
|
-
declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
|
|
1836
|
-
declare function afterSellItems(cargo: Types.cargo_item[], goodsToSell: Array<{
|
|
1837
|
-
goodId: number;
|
|
1838
|
-
quantity: number;
|
|
1839
|
-
}>): EntityInventory[];
|
|
1840
|
-
declare function afterSellAllItems(cargo: Types.cargo_item[]): EntityInventory[];
|
|
1841
|
-
|
|
1842
|
-
type cargoUtils_CargoData = CargoData;
|
|
1843
|
-
declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
|
|
1844
|
-
declare const cargoUtils_cargoValue: typeof cargoValue;
|
|
1845
|
-
declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
|
|
1846
|
-
declare const cargoUtils_hasSpace: typeof hasSpace;
|
|
1847
|
-
declare const cargoUtils_availableCapacity: typeof availableCapacity;
|
|
1848
|
-
declare const cargoUtils_isFull: typeof isFull;
|
|
1849
|
-
type cargoUtils_SaleValue = SaleValue;
|
|
1850
|
-
declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
|
|
1851
|
-
declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
|
|
1852
|
-
declare const cargoUtils_afterSellItems: typeof afterSellItems;
|
|
1853
|
-
declare const cargoUtils_afterSellAllItems: typeof afterSellAllItems;
|
|
1854
|
-
declare namespace cargoUtils {
|
|
1855
|
-
export {
|
|
1856
|
-
cargoUtils_CargoData as CargoData,
|
|
1857
|
-
cargoUtils_totalCargoMass as totalCargoMass,
|
|
1858
|
-
cargoUtils_cargoValue as cargoValue,
|
|
1859
|
-
cargoUtils_getCargoForItem as getCargoForItem,
|
|
1860
|
-
cargoUtils_hasSpace as hasSpace,
|
|
1861
|
-
cargoUtils_availableCapacity as availableCapacity,
|
|
1862
|
-
cargoUtils_isFull as isFull,
|
|
1863
|
-
cargoUtils_SaleValue as SaleValue,
|
|
1864
|
-
cargoUtils_calculateSaleValue as calculateSaleValue,
|
|
1865
|
-
cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
|
|
1866
|
-
cargoUtils_afterSellItems as afterSellItems,
|
|
1867
|
-
cargoUtils_afterSellAllItems as afterSellAllItems,
|
|
1868
|
-
};
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
1568
|
interface ShipStateInput {
|
|
1872
1569
|
id: UInt64Type;
|
|
1873
1570
|
owner: string;
|
|
@@ -1909,7 +1606,6 @@ declare class Ship extends Types.entity_info {
|
|
|
1909
1606
|
projectAt(now: Date): ProjectedEntity;
|
|
1910
1607
|
get location(): Location;
|
|
1911
1608
|
get totalCargoMass(): UInt64;
|
|
1912
|
-
get cargoValue(): UInt64;
|
|
1913
1609
|
get totalMass(): UInt64;
|
|
1914
1610
|
get maxCapacity(): UInt64;
|
|
1915
1611
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
@@ -1922,440 +1618,6 @@ declare class Ship extends Types.entity_info {
|
|
|
1922
1618
|
get energyPercent(): number;
|
|
1923
1619
|
get needsRecharge(): boolean;
|
|
1924
1620
|
hasEnergyFor(distance: UInt64): boolean;
|
|
1925
|
-
calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
|
|
1926
|
-
calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
|
|
1927
|
-
afterSellItems(goodsToSell: Array<{
|
|
1928
|
-
goodId: number;
|
|
1929
|
-
quantity: number;
|
|
1930
|
-
}>): EntityInventory[];
|
|
1931
|
-
afterSellAllItems(): EntityInventory[];
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
/**
|
|
1935
|
-
* Travel calculations for ship movement, energy usage, and flight times.
|
|
1936
|
-
*
|
|
1937
|
-
* Functions prefixed with `calc_` are contract-parity functions that mirror
|
|
1938
|
-
* the C++ implementation in the server contract (schedule.cpp, ship.cpp).
|
|
1939
|
-
* These use snake_case intentionally to match the contract naming convention
|
|
1940
|
-
* and signal that they must produce identical results to the on-chain code.
|
|
1941
|
-
*
|
|
1942
|
-
* Functions prefixed with `calculate` are higher-level SDK helpers that may
|
|
1943
|
-
* combine multiple contract calculations for convenience.
|
|
1944
|
-
*/
|
|
1945
|
-
|
|
1946
|
-
declare function calc_orbital_altitude(mass: number): number;
|
|
1947
|
-
declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
|
|
1948
|
-
declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
|
|
1949
|
-
declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
|
|
1950
|
-
declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
|
|
1951
|
-
declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
|
|
1952
|
-
declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
|
|
1953
|
-
declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
|
|
1954
|
-
declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
|
|
1955
|
-
declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
|
|
1956
|
-
declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1957
|
-
declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
|
|
1958
|
-
declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1959
|
-
declare function calc_acceleration(thrust: number, mass: number): number;
|
|
1960
|
-
declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
|
|
1961
|
-
declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
|
|
1962
|
-
declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
|
|
1963
|
-
declare function calculateRefuelingTime(ship: ShipLike): UInt32;
|
|
1964
|
-
declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
|
|
1965
|
-
interface LoadTimeBreakdown {
|
|
1966
|
-
unloadTime: number;
|
|
1967
|
-
loadTime: number;
|
|
1968
|
-
totalTime: number;
|
|
1969
|
-
unloadMass: number;
|
|
1970
|
-
loadMass: number;
|
|
1971
|
-
}
|
|
1972
|
-
declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
|
|
1973
|
-
interface EstimatedTravelTime {
|
|
1974
|
-
flightTime: UInt32;
|
|
1975
|
-
rechargeTime: UInt32;
|
|
1976
|
-
loadTime: UInt32;
|
|
1977
|
-
unloadTime: UInt32;
|
|
1978
|
-
total: UInt32;
|
|
1979
|
-
}
|
|
1980
|
-
interface EstimateTravelTimeOptions {
|
|
1981
|
-
needsRecharge?: boolean;
|
|
1982
|
-
loadMass?: UInt32Type;
|
|
1983
|
-
unloadMass?: UInt32Type;
|
|
1984
|
-
}
|
|
1985
|
-
declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
|
|
1986
|
-
declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
|
|
1987
|
-
declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
|
|
1988
|
-
interface TransferEntity {
|
|
1989
|
-
location: {
|
|
1990
|
-
z?: {
|
|
1991
|
-
toNumber(): number;
|
|
1992
|
-
} | number;
|
|
1993
|
-
};
|
|
1994
|
-
loaders?: {
|
|
1995
|
-
thrust: {
|
|
1996
|
-
toNumber(): number;
|
|
1997
|
-
} | number;
|
|
1998
|
-
mass: {
|
|
1999
|
-
toNumber(): number;
|
|
2000
|
-
} | number;
|
|
2001
|
-
quantity: {
|
|
2002
|
-
toNumber(): number;
|
|
2003
|
-
} | number;
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
interface HasScheduleAndLocation {
|
|
2007
|
-
coordinates: ActionParams.Type.coordinates;
|
|
2008
|
-
schedule?: Types.schedule;
|
|
2009
|
-
}
|
|
2010
|
-
declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
|
|
2011
|
-
declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
|
|
2012
|
-
declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
|
|
2013
|
-
declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
|
|
2014
|
-
|
|
2015
|
-
/**
|
|
2016
|
-
* Trading deal interface representing a profitable trade opportunity
|
|
2017
|
-
*/
|
|
2018
|
-
interface Deal {
|
|
2019
|
-
/** Origin location */
|
|
2020
|
-
origin: Location;
|
|
2021
|
-
/** Destination location */
|
|
2022
|
-
destination: Location;
|
|
2023
|
-
/** Item to trade */
|
|
2024
|
-
item: ItemPrice;
|
|
2025
|
-
/** Distance between origin and destination */
|
|
2026
|
-
distance: UInt64;
|
|
2027
|
-
/** Available supply at origin */
|
|
2028
|
-
supply: UInt16;
|
|
2029
|
-
/** Buy price at origin */
|
|
2030
|
-
buyPrice: UInt32;
|
|
2031
|
-
/** Sell price at destination */
|
|
2032
|
-
sellPrice: UInt32;
|
|
2033
|
-
/** Profit per unit */
|
|
2034
|
-
profitPerUnit: UInt32;
|
|
2035
|
-
/** Maximum quantity that can be traded */
|
|
2036
|
-
maxQuantity: UInt32;
|
|
2037
|
-
/** Total profit for max quantity */
|
|
2038
|
-
totalProfit: Int64;
|
|
2039
|
-
/** Estimated travel time in seconds */
|
|
2040
|
-
travelTime: UInt32;
|
|
2041
|
-
/** Detailed breakdown of travel time components */
|
|
2042
|
-
travelTimeBreakdown: EstimatedTravelTime;
|
|
2043
|
-
/** Profit per second (floating point for UI display) */
|
|
2044
|
-
profitPerSecond: number;
|
|
2045
|
-
/** Profit margin percentage (floating point for UI display) */
|
|
2046
|
-
marginPercent: number;
|
|
2047
|
-
}
|
|
2048
|
-
/**
|
|
2049
|
-
* Options for finding deals
|
|
2050
|
-
*/
|
|
2051
|
-
interface FindDealsOptions {
|
|
2052
|
-
/** Maximum number of deals to return */
|
|
2053
|
-
maxDeals?: number;
|
|
2054
|
-
/** Maximum search distance */
|
|
2055
|
-
maxDistance?: number;
|
|
2056
|
-
/** Player's current balance (for affordability filtering) */
|
|
2057
|
-
playerBalance?: UInt64Type;
|
|
2058
|
-
/** Minimum profit per second threshold */
|
|
2059
|
-
minProfitPerSecond?: number;
|
|
2060
|
-
/** Minimum profit margin percentage */
|
|
2061
|
-
minMarginPercent?: number;
|
|
2062
|
-
/** Override available cargo space (in mass units). If provided, uses this instead of calculating from ship's current cargo. */
|
|
2063
|
-
availableSpace?: number;
|
|
2064
|
-
}
|
|
2065
|
-
/**
|
|
2066
|
-
* Calculate deals for a ship from a specific origin location
|
|
2067
|
-
*/
|
|
2068
|
-
declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
|
|
2069
|
-
/**
|
|
2070
|
-
* Find the single best deal for a ship from a specific origin location
|
|
2071
|
-
*/
|
|
2072
|
-
declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
|
|
2073
|
-
|
|
2074
|
-
/**
|
|
2075
|
-
* Types of collect actions available to the player
|
|
2076
|
-
*/
|
|
2077
|
-
type CollectActionType = 'sell-and-trade' | 'sell-and-reposition' | 'travel-to-sell' | 'sell-and-stay' | 'explore' | 'orbit';
|
|
2078
|
-
/**
|
|
2079
|
-
* Represents a single collect option presented to the player
|
|
2080
|
-
*/
|
|
2081
|
-
interface CollectOption {
|
|
2082
|
-
/** Unique identifier for this option */
|
|
2083
|
-
id: string;
|
|
2084
|
-
/** Type of action sequence */
|
|
2085
|
-
type: CollectActionType;
|
|
2086
|
-
/** Human-readable title */
|
|
2087
|
-
title: string;
|
|
2088
|
-
/** Detailed description of what will happen */
|
|
2089
|
-
description: string;
|
|
2090
|
-
/** Brief explanation of why this option is worth considering */
|
|
2091
|
-
reason: string;
|
|
2092
|
-
/** Whether this is the recommended option (best profitPerSecond with quality threshold) */
|
|
2093
|
-
recommended: boolean;
|
|
2094
|
-
/** Whether this option has the highest absolute profit (may differ from recommended) */
|
|
2095
|
-
highestProfit: boolean;
|
|
2096
|
-
/** Estimated profit/loss from this action */
|
|
2097
|
-
estimatedProfit: UInt64;
|
|
2098
|
-
/** Revenue from selling cargo (if applicable) */
|
|
2099
|
-
saleRevenue?: UInt64;
|
|
2100
|
-
/** Cost of purchasing new cargo (if applicable) */
|
|
2101
|
-
purchaseCost?: UInt64;
|
|
2102
|
-
/** Expected profit from the next trade (if applicable) */
|
|
2103
|
-
nextTradeProfit?: UInt64;
|
|
2104
|
-
/** Profit per second for this option (floating point for display) */
|
|
2105
|
-
profitPerSecond?: number;
|
|
2106
|
-
/** Margin percentage for the deal (floating point for display) */
|
|
2107
|
-
marginPercent?: number;
|
|
2108
|
-
/** Destination location (if traveling) */
|
|
2109
|
-
destination?: Location;
|
|
2110
|
-
/** Deal to execute (if buying goods) */
|
|
2111
|
-
deal?: Deal;
|
|
2112
|
-
/** Sale location if different from current */
|
|
2113
|
-
saleLocation?: Location;
|
|
2114
|
-
/** Price per unit at sale location */
|
|
2115
|
-
salePrice?: UInt32;
|
|
2116
|
-
/** Price per unit at current location (for comparison) */
|
|
2117
|
-
currentPrice?: UInt32;
|
|
2118
|
-
/** Estimated travel time in seconds (undefined = instant/no travel) */
|
|
2119
|
-
travelTime?: UInt32;
|
|
2120
|
-
/** Detailed breakdown of travel time components */
|
|
2121
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
2122
|
-
/** Info about a discounted good at the destination (for explore options) */
|
|
2123
|
-
discountedGood?: DiscountedItemInfo;
|
|
2124
|
-
/** Top potential deals available at destination (for explore options) */
|
|
2125
|
-
potentialDeals?: PotentialDeal[];
|
|
2126
|
-
/** Details of cargo being sold (if selling cargo) */
|
|
2127
|
-
cargoSale?: CargoSaleItem[];
|
|
2128
|
-
/** Total profit/loss from selling cargo */
|
|
2129
|
-
cargoProfitLoss?: Int64;
|
|
2130
|
-
}
|
|
2131
|
-
/**
|
|
2132
|
-
* Analysis result for collect options
|
|
2133
|
-
*/
|
|
2134
|
-
interface CollectAnalysis {
|
|
2135
|
-
/** Current location where ship arrived */
|
|
2136
|
-
arrivedAt: Coordinates;
|
|
2137
|
-
/** Ship being analyzed */
|
|
2138
|
-
ship: Ship;
|
|
2139
|
-
/** Current cargo on ship */
|
|
2140
|
-
cargo: EntityInventory[];
|
|
2141
|
-
/** Value of cargo if sold at current location */
|
|
2142
|
-
cargoValueHere: UInt64;
|
|
2143
|
-
/** All available options, sorted by estimated profit */
|
|
2144
|
-
options: CollectOption[];
|
|
2145
|
-
/** Whether any profitable options exist */
|
|
2146
|
-
hasProfitableOptions: boolean;
|
|
2147
|
-
}
|
|
2148
|
-
/**
|
|
2149
|
-
* Options for analyzing collect choices
|
|
2150
|
-
*/
|
|
2151
|
-
interface CollectAnalysisOptions {
|
|
2152
|
-
/** Player's current balance (defaults to Infinity) */
|
|
2153
|
-
playerBalance?: number;
|
|
2154
|
-
/** Maximum distance to search (defaults to ship's max range) */
|
|
2155
|
-
maxDistance?: number;
|
|
2156
|
-
/** Minimum profit improvement to suggest traveling elsewhere to sell */
|
|
2157
|
-
minSaleImprovement?: number;
|
|
2158
|
-
}
|
|
2159
|
-
/**
|
|
2160
|
-
* Find locations where current cargo could be sold for more
|
|
2161
|
-
*/
|
|
2162
|
-
interface BetterSaleLocation {
|
|
2163
|
-
location: Location;
|
|
2164
|
-
/** Price per unit at this location */
|
|
2165
|
-
price: UInt32;
|
|
2166
|
-
/** Total revenue if sold here */
|
|
2167
|
-
revenue: UInt64;
|
|
2168
|
-
/** Difference vs selling at current location */
|
|
2169
|
-
improvement: Int64;
|
|
2170
|
-
/** Best deal available at this location after selling */
|
|
2171
|
-
bestDealAfterSale?: Deal;
|
|
2172
|
-
/** Distance to this location */
|
|
2173
|
-
distance: UInt64;
|
|
2174
|
-
/** Estimated travel time */
|
|
2175
|
-
travelTime: UInt32;
|
|
2176
|
-
/** Detailed breakdown of travel time components */
|
|
2177
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
2178
|
-
}
|
|
2179
|
-
/**
|
|
2180
|
-
* Find locations with good deals when current location has none
|
|
2181
|
-
*/
|
|
2182
|
-
interface RepositionLocation {
|
|
2183
|
-
location: Location;
|
|
2184
|
-
/** Best deal available at this location */
|
|
2185
|
-
bestDeal: Deal;
|
|
2186
|
-
/** Distance to this location */
|
|
2187
|
-
distance: UInt64;
|
|
2188
|
-
/** Estimated travel time */
|
|
2189
|
-
travelTime: UInt32;
|
|
2190
|
-
/** Detailed breakdown of travel time components */
|
|
2191
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
2192
|
-
}
|
|
2193
|
-
/**
|
|
2194
|
-
* Analyze cargo sale value at a specific location
|
|
2195
|
-
*/
|
|
2196
|
-
declare function analyzeCargoSale(cargo: EntityInventory[], prices: Map<number, UInt64>): {
|
|
2197
|
-
revenue: UInt64;
|
|
2198
|
-
cost: UInt64;
|
|
2199
|
-
profit: Int64;
|
|
2200
|
-
};
|
|
2201
|
-
/**
|
|
2202
|
-
* Create a "Sell & Trade" option (full loop)
|
|
2203
|
-
*/
|
|
2204
|
-
declare function createSellAndTradeOption(saleRevenue: UInt64, saleCost: UInt64, deal: Deal, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
|
|
2205
|
-
/**
|
|
2206
|
-
* Create a "Travel to Sell" option (better market elsewhere)
|
|
2207
|
-
*/
|
|
2208
|
-
declare function createTravelToSellOption(currentRevenue: UInt64, cargoCost: UInt64, betterSale: BetterSaleLocation, cargo: EntityInventory[], destPrices?: Map<number, UInt64>): CollectOption;
|
|
2209
|
-
/**
|
|
2210
|
-
* Create a "Sell & Reposition" option (sell here, travel empty to deals)
|
|
2211
|
-
*/
|
|
2212
|
-
declare function createSellAndRepositionOption(saleRevenue: UInt64, saleCost: UInt64, reposition: RepositionLocation, cargoSale?: CargoSaleItem[]): CollectOption;
|
|
2213
|
-
/**
|
|
2214
|
-
* Create a "Sell & Stay" option (just sell, stay idle)
|
|
2215
|
-
*/
|
|
2216
|
-
declare function createSellAndStayOption(saleRevenue: UInt64, saleCost: UInt64, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
|
|
2217
|
-
/**
|
|
2218
|
-
* Details about a cargo item being sold
|
|
2219
|
-
*/
|
|
2220
|
-
interface CargoSaleItem {
|
|
2221
|
-
goodId: UInt16;
|
|
2222
|
-
goodName: string;
|
|
2223
|
-
quantity: UInt32;
|
|
2224
|
-
/** Price per unit at sale location */
|
|
2225
|
-
pricePerUnit: UInt32;
|
|
2226
|
-
/** Total revenue from this item */
|
|
2227
|
-
revenue: UInt64;
|
|
2228
|
-
/** Original cost (paid) per unit */
|
|
2229
|
-
costPerUnit: UInt64;
|
|
2230
|
-
/** Profit/loss on this item */
|
|
2231
|
-
profit: Int64;
|
|
2232
|
-
}
|
|
2233
|
-
/**
|
|
2234
|
-
* Info about a discounted good for explore options
|
|
2235
|
-
*/
|
|
2236
|
-
interface DiscountedItemInfo {
|
|
2237
|
-
goodId: number;
|
|
2238
|
-
name: string;
|
|
2239
|
-
rarity: string;
|
|
2240
|
-
discountPercent: number;
|
|
2241
|
-
}
|
|
2242
|
-
/**
|
|
2243
|
-
* A potential deal available at a destination (for explore options)
|
|
2244
|
-
*/
|
|
2245
|
-
interface PotentialDeal {
|
|
2246
|
-
goodId: number;
|
|
2247
|
-
goodName: string;
|
|
2248
|
-
destinationCoords: Coordinates;
|
|
2249
|
-
marginPercent: number;
|
|
2250
|
-
profitPerSecond: number;
|
|
2251
|
-
}
|
|
2252
|
-
/**
|
|
2253
|
-
* Create an "Explore" option (travel to find opportunities)
|
|
2254
|
-
*/
|
|
2255
|
-
declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedItemInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
|
|
2256
|
-
/**
|
|
2257
|
-
* Callbacks for collect analysis (provided by manager)
|
|
2258
|
-
*/
|
|
2259
|
-
interface CollectAnalysisCallbacks {
|
|
2260
|
-
getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
|
|
2261
|
-
getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>;
|
|
2262
|
-
getGameSeed?: () => Checksum256Type;
|
|
2263
|
-
getState?: () => Types.state_row;
|
|
2264
|
-
}
|
|
2265
|
-
/**
|
|
2266
|
-
* Analyze all collect options for a ship that has arrived at its destination.
|
|
2267
|
-
* Returns all available options sorted by estimated profit.
|
|
2268
|
-
*/
|
|
2269
|
-
declare function analyzeCollectOptions(ship: Ship, arrivedAt: Coordinates, callbacks: CollectAnalysisCallbacks, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
|
|
2270
|
-
|
|
2271
|
-
declare class TradesManager extends BaseManager {
|
|
2272
|
-
private priceCache;
|
|
2273
|
-
private priceCacheEpoch;
|
|
2274
|
-
private makePriceCacheKey;
|
|
2275
|
-
private createCallbacks;
|
|
2276
|
-
clearPriceCache(): void;
|
|
2277
|
-
findDeals(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal[]>;
|
|
2278
|
-
findBestDeal(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal | undefined>;
|
|
2279
|
-
getCollectOptions(ship: Ship, arrivedAt?: Coordinates, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
|
-
declare class EpochsManager extends BaseManager {
|
|
2283
|
-
getCurrentHeight(): Promise<UInt64>;
|
|
2284
|
-
getCurrent(): Promise<EpochInfo>;
|
|
2285
|
-
getByHeight(height: UInt64Type): Promise<EpochInfo>;
|
|
2286
|
-
getTimeRemaining(): Promise<number>;
|
|
2287
|
-
getProgress(): Promise<number>;
|
|
2288
|
-
fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
interface SellableCargo {
|
|
2292
|
-
item_id: {
|
|
2293
|
-
toNumber(): number;
|
|
2294
|
-
} | number;
|
|
2295
|
-
quantity: {
|
|
2296
|
-
toNumber(): number;
|
|
2297
|
-
} | number;
|
|
2298
|
-
hasCargo: boolean;
|
|
2299
|
-
}
|
|
2300
|
-
type EntityRefInput = {
|
|
2301
|
-
entityType: EntityTypeName;
|
|
2302
|
-
entityId: UInt64Type;
|
|
2303
|
-
};
|
|
2304
|
-
declare class ActionsManager extends BaseManager {
|
|
2305
|
-
travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
|
|
2306
|
-
grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
|
|
2307
|
-
resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2308
|
-
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2309
|
-
recharge(shipId: UInt64Type): Action;
|
|
2310
|
-
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
|
|
2311
|
-
buyItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2312
|
-
sellItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2313
|
-
buyShip(account: NameType, name: string): Action;
|
|
2314
|
-
buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
2315
|
-
buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
2316
|
-
takeLoan(account: NameType, amount: UInt64Type): Action;
|
|
2317
|
-
payLoan(account: NameType, amount: UInt64Type): Action;
|
|
2318
|
-
foundCompany(account: NameType, name: string): Action;
|
|
2319
|
-
join(account: NameType): Action;
|
|
2320
|
-
extract(shipId: UInt64Type): Action;
|
|
2321
|
-
warp(shipId: UInt64Type, destination: CoordinatesType): Action;
|
|
2322
|
-
joinGame(account: NameType, companyName: string): Action[];
|
|
2323
|
-
sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
declare class GameContext {
|
|
2327
|
-
readonly client: APIClient;
|
|
2328
|
-
readonly server: Contract$2;
|
|
2329
|
-
readonly platform: Contract$2;
|
|
2330
|
-
private _entities?;
|
|
2331
|
-
private _players?;
|
|
2332
|
-
private _locations?;
|
|
2333
|
-
private _trades?;
|
|
2334
|
-
private _epochs?;
|
|
2335
|
-
private _actions?;
|
|
2336
|
-
private _gameCache?;
|
|
2337
|
-
private _stateCache?;
|
|
2338
|
-
constructor(client: APIClient, server: Contract$2, platform: Contract$2);
|
|
2339
|
-
get entities(): EntitiesManager;
|
|
2340
|
-
get players(): PlayersManager;
|
|
2341
|
-
get locations(): LocationsManager;
|
|
2342
|
-
get trades(): TradesManager;
|
|
2343
|
-
get epochs(): EpochsManager;
|
|
2344
|
-
get actions(): ActionsManager;
|
|
2345
|
-
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
2346
|
-
getState(reload?: boolean): Promise<GameState>;
|
|
2347
|
-
get cachedGame(): Types$1.game_row | undefined;
|
|
2348
|
-
get cachedState(): GameState | undefined;
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
declare abstract class BaseManager {
|
|
2352
|
-
protected readonly context: GameContext;
|
|
2353
|
-
constructor(context: GameContext);
|
|
2354
|
-
protected get client(): _wharfkit_antelope.APIClient;
|
|
2355
|
-
protected get server(): _wharfkit_contract.Contract;
|
|
2356
|
-
protected get platform(): _wharfkit_contract.Contract;
|
|
2357
|
-
protected getGame(): Promise<Types$1.game_row>;
|
|
2358
|
-
protected getState(): Promise<GameState>;
|
|
2359
1621
|
}
|
|
2360
1622
|
|
|
2361
1623
|
interface WarehouseStateInput {
|
|
@@ -2384,7 +1646,6 @@ declare class Warehouse extends Types.entity_info {
|
|
|
2384
1646
|
isUnloading(now: Date): boolean;
|
|
2385
1647
|
get location(): Location;
|
|
2386
1648
|
get totalCargoMass(): UInt64;
|
|
2387
|
-
get cargoValue(): UInt64;
|
|
2388
1649
|
get maxCapacity(): UInt64;
|
|
2389
1650
|
get availableCapacity(): UInt64;
|
|
2390
1651
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
@@ -2422,6 +1683,10 @@ declare class Container extends Types.entity_info {
|
|
|
2422
1683
|
get isFull(): boolean;
|
|
2423
1684
|
get orbitalAltitude(): number;
|
|
2424
1685
|
}
|
|
1686
|
+
declare function computeContainerCapabilities(stats: Record<string, number>): {
|
|
1687
|
+
hullmass: number;
|
|
1688
|
+
capacity: number;
|
|
1689
|
+
};
|
|
2425
1690
|
|
|
2426
1691
|
type EntityType = 'ship' | 'warehouse' | 'container' | 'location';
|
|
2427
1692
|
declare class EntitiesManager extends BaseManager {
|
|
@@ -2460,7 +1725,6 @@ declare class Shipload {
|
|
|
2460
1725
|
get entities(): EntitiesManager;
|
|
2461
1726
|
get players(): PlayersManager;
|
|
2462
1727
|
get locations(): LocationsManager;
|
|
2463
|
-
get trades(): TradesManager;
|
|
2464
1728
|
get epochs(): EpochsManager;
|
|
2465
1729
|
get actions(): ActionsManager;
|
|
2466
1730
|
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
@@ -2475,23 +1739,6 @@ declare const itemIds: UInt16[];
|
|
|
2475
1739
|
declare function getItem(itemId: UInt16Type): Item;
|
|
2476
1740
|
declare function getItems(): Item[];
|
|
2477
1741
|
|
|
2478
|
-
declare enum Rarities {
|
|
2479
|
-
legendary = "LEGENDARY",
|
|
2480
|
-
epic = "EPIC",
|
|
2481
|
-
rare = "RARE",
|
|
2482
|
-
uncommon = "UNCOMMON",
|
|
2483
|
-
common = "COMMON",
|
|
2484
|
-
trash = "TRASH"
|
|
2485
|
-
}
|
|
2486
|
-
interface Rarity {
|
|
2487
|
-
rarity: Rarities;
|
|
2488
|
-
minMultiplier: number;
|
|
2489
|
-
maxMultiplier: number;
|
|
2490
|
-
}
|
|
2491
|
-
declare function getRarity(gameSeed: Checksum256Type, epochSeed: Checksum256Type, location: CoordinatesType, goodId: UInt16Type): Rarity;
|
|
2492
|
-
declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice;
|
|
2493
|
-
declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice[];
|
|
2494
|
-
|
|
2495
1742
|
declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
|
|
2496
1743
|
declare function isExtractableLocation(locationType: LocationType): boolean;
|
|
2497
1744
|
declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
|
|
@@ -2507,21 +1754,20 @@ interface StratumInfo {
|
|
|
2507
1754
|
reserve: number;
|
|
2508
1755
|
}
|
|
2509
1756
|
interface ResourceStats {
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
resonance: number;
|
|
1757
|
+
stat1: number;
|
|
1758
|
+
stat2: number;
|
|
1759
|
+
stat3: number;
|
|
2514
1760
|
}
|
|
2515
1761
|
declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
|
|
2516
1762
|
declare function deriveResourceStats(seed: bigint): ResourceStats;
|
|
2517
1763
|
|
|
2518
1764
|
declare function deriveLocationSize(loc: Types.location_static): number;
|
|
2519
1765
|
|
|
2520
|
-
declare const
|
|
2521
|
-
declare const
|
|
2522
|
-
declare const
|
|
2523
|
-
declare const
|
|
2524
|
-
declare const
|
|
1766
|
+
declare const DEPTH_THRESHOLD_T1 = 0;
|
|
1767
|
+
declare const DEPTH_THRESHOLD_T2 = 2000;
|
|
1768
|
+
declare const DEPTH_THRESHOLD_T3 = 10000;
|
|
1769
|
+
declare const DEPTH_THRESHOLD_T4 = 30000;
|
|
1770
|
+
declare const DEPTH_THRESHOLD_T5 = 55000;
|
|
2525
1771
|
declare const LOCATION_MIN_DEPTH = 500;
|
|
2526
1772
|
declare const LOCATION_MAX_DEPTH = 65535;
|
|
2527
1773
|
declare const PLANET_SUBTYPE_GAS_GIANT = 0;
|
|
@@ -2530,95 +1776,178 @@ declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
|
|
|
2530
1776
|
declare const PLANET_SUBTYPE_ICY = 3;
|
|
2531
1777
|
declare const PLANET_SUBTYPE_OCEAN = 4;
|
|
2532
1778
|
declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
|
|
2533
|
-
declare function getDepthThreshold(
|
|
2534
|
-
declare function
|
|
1779
|
+
declare function getDepthThreshold(tier: ResourceTier): number;
|
|
1780
|
+
declare function getResourceTier(itemId: number): ResourceTier;
|
|
2535
1781
|
declare function getResourceWeight(itemId: number, stratum: number): number;
|
|
2536
1782
|
declare function getLocationCandidates(locationType: number, subtype: number): number[];
|
|
2537
1783
|
declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
|
|
2538
1784
|
declare function depthScaleFactor(stratum: number): number;
|
|
2539
1785
|
|
|
1786
|
+
interface StatDefinition {
|
|
1787
|
+
key: string;
|
|
1788
|
+
label: string;
|
|
1789
|
+
abbreviation: string;
|
|
1790
|
+
purpose: string;
|
|
1791
|
+
inverted?: boolean;
|
|
1792
|
+
}
|
|
1793
|
+
declare function getStatDefinitions(category: ResourceCategory): StatDefinition[];
|
|
1794
|
+
declare function getStatName(category: ResourceCategory, index: 0 | 1 | 2): StatDefinition;
|
|
1795
|
+
interface NamedStats {
|
|
1796
|
+
definitions: StatDefinition[];
|
|
1797
|
+
values: [number, number, number];
|
|
1798
|
+
}
|
|
1799
|
+
declare function resolveStats(category: ResourceCategory, stats: {
|
|
1800
|
+
stat1: number;
|
|
1801
|
+
stat2: number;
|
|
1802
|
+
stat3: number;
|
|
1803
|
+
}): NamedStats;
|
|
1804
|
+
|
|
1805
|
+
interface StackInput {
|
|
1806
|
+
quantity: number;
|
|
1807
|
+
stats: Record<string, number>;
|
|
1808
|
+
}
|
|
1809
|
+
interface CategoryStacks {
|
|
1810
|
+
category: ResourceCategory;
|
|
1811
|
+
stacks: StackInput[];
|
|
1812
|
+
}
|
|
1813
|
+
declare function encodeStats(values: number[]): bigint;
|
|
1814
|
+
declare function decodeStats(seed: bigint, count: number): number[];
|
|
1815
|
+
declare function decodeCraftedItemStats(itemId: number, seed: bigint): Record<string, number>;
|
|
1816
|
+
declare function blendStacks(stacks: StackInput[], statKey: string): number;
|
|
1817
|
+
declare function computeComponentStats(componentId: number, categoryStacks: CategoryStacks[]): {
|
|
1818
|
+
key: string;
|
|
1819
|
+
value: number;
|
|
1820
|
+
}[];
|
|
1821
|
+
declare function blendComponentStacks(stacks: {
|
|
1822
|
+
quantity: number;
|
|
1823
|
+
stats: Record<string, number>;
|
|
1824
|
+
}[]): Record<string, number>;
|
|
1825
|
+
declare function computeEntityStats(entityRecipeId: string, componentStacks: Record<number, {
|
|
1826
|
+
quantity: number;
|
|
1827
|
+
stats: Record<string, number>;
|
|
1828
|
+
}[]>): {
|
|
1829
|
+
key: string;
|
|
1830
|
+
value: number;
|
|
1831
|
+
}[];
|
|
1832
|
+
|
|
2540
1833
|
declare function hash(seed: Checksum256Type, string: string): Checksum256;
|
|
2541
1834
|
declare function hash512(seed: Checksum256Type, string: string): Checksum512;
|
|
2542
1835
|
|
|
2543
1836
|
/**
|
|
2544
|
-
*
|
|
2545
|
-
*/
|
|
2546
|
-
interface TradeCalculation {
|
|
2547
|
-
maxQuantity: number;
|
|
2548
|
-
totalCost: number;
|
|
2549
|
-
totalMass: UInt64;
|
|
2550
|
-
affordableQuantity: number;
|
|
2551
|
-
spaceForQuantity: number;
|
|
2552
|
-
}
|
|
2553
|
-
/**
|
|
2554
|
-
* Calculate updated weighted average cargo cost after purchase.
|
|
2555
|
-
* Matches contract logic: (paid * owned + cost) / (owned + quantity)
|
|
1837
|
+
* Travel calculations for ship movement, energy usage, and flight times.
|
|
2556
1838
|
*
|
|
2557
|
-
*
|
|
2558
|
-
*
|
|
2559
|
-
*
|
|
2560
|
-
*
|
|
2561
|
-
* @returns New weighted average cost per unit
|
|
1839
|
+
* Functions prefixed with `calc_` are contract-parity functions that mirror
|
|
1840
|
+
* the C++ implementation in the server contract (schedule.cpp, ship.cpp).
|
|
1841
|
+
* These use snake_case intentionally to match the contract naming convention
|
|
1842
|
+
* and signal that they must produce identical results to the on-chain code.
|
|
2562
1843
|
*
|
|
2563
|
-
*
|
|
2564
|
-
*
|
|
2565
|
-
* const newPaid = calculateUpdatedCargoCost(
|
|
2566
|
-
* UInt64.from(100),
|
|
2567
|
-
* UInt32.from(10),
|
|
2568
|
-
* UInt64.from(600),
|
|
2569
|
-
* UInt32.from(5)
|
|
2570
|
-
* )
|
|
2571
|
-
* // Result: (100*10 + 600) / (10+5) = 106.67 per unit
|
|
2572
|
-
*/
|
|
2573
|
-
declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UInt32, purchaseCost: UInt64, purchaseQuantity: UInt32): UInt64;
|
|
2574
|
-
/**
|
|
2575
|
-
* Calculate the maximum quantity of a good a ship can buy
|
|
2576
|
-
* considering both space and player balance
|
|
2577
|
-
*/
|
|
2578
|
-
declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: ItemPrice): TradeCalculation;
|
|
2579
|
-
/**
|
|
2580
|
-
* Trade profit calculation result
|
|
1844
|
+
* Functions prefixed with `calculate` are higher-level SDK helpers that may
|
|
1845
|
+
* combine multiple contract calculations for convenience.
|
|
2581
1846
|
*/
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
1847
|
+
|
|
1848
|
+
declare function calc_orbital_altitude(mass: number): number;
|
|
1849
|
+
declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
|
|
1850
|
+
declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
|
|
1851
|
+
declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
|
|
1852
|
+
declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
|
|
1853
|
+
declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
|
|
1854
|
+
declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
|
|
1855
|
+
declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
|
|
1856
|
+
declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
|
|
1857
|
+
declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
|
|
1858
|
+
declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1859
|
+
declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
|
|
1860
|
+
declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1861
|
+
declare function calc_acceleration(thrust: number, mass: number): number;
|
|
1862
|
+
declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
|
|
1863
|
+
declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
|
|
1864
|
+
declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
|
|
1865
|
+
declare function calculateRefuelingTime(ship: ShipLike): UInt32;
|
|
1866
|
+
declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
|
|
1867
|
+
interface LoadTimeBreakdown {
|
|
1868
|
+
unloadTime: number;
|
|
1869
|
+
loadTime: number;
|
|
1870
|
+
totalTime: number;
|
|
1871
|
+
unloadMass: number;
|
|
1872
|
+
loadMass: number;
|
|
2587
1873
|
}
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
declare function
|
|
2604
|
-
|
|
1874
|
+
declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
|
|
1875
|
+
interface EstimatedTravelTime {
|
|
1876
|
+
flightTime: UInt32;
|
|
1877
|
+
rechargeTime: UInt32;
|
|
1878
|
+
loadTime: UInt32;
|
|
1879
|
+
unloadTime: UInt32;
|
|
1880
|
+
total: UInt32;
|
|
1881
|
+
}
|
|
1882
|
+
interface EstimateTravelTimeOptions {
|
|
1883
|
+
needsRecharge?: boolean;
|
|
1884
|
+
loadMass?: UInt32Type;
|
|
1885
|
+
unloadMass?: UInt32Type;
|
|
1886
|
+
}
|
|
1887
|
+
declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
|
|
1888
|
+
declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
|
|
1889
|
+
declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
|
|
1890
|
+
interface TransferEntity {
|
|
1891
|
+
location: {
|
|
1892
|
+
z?: {
|
|
1893
|
+
toNumber(): number;
|
|
1894
|
+
} | number;
|
|
1895
|
+
};
|
|
1896
|
+
loaders?: {
|
|
1897
|
+
thrust: {
|
|
1898
|
+
toNumber(): number;
|
|
1899
|
+
} | number;
|
|
1900
|
+
mass: {
|
|
1901
|
+
toNumber(): number;
|
|
1902
|
+
} | number;
|
|
1903
|
+
quantity: {
|
|
1904
|
+
toNumber(): number;
|
|
1905
|
+
} | number;
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
interface HasScheduleAndLocation {
|
|
1909
|
+
coordinates: ActionParams.Type.coordinates;
|
|
1910
|
+
schedule?: Types.schedule;
|
|
1911
|
+
}
|
|
1912
|
+
declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
|
|
1913
|
+
declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
|
|
1914
|
+
declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
|
|
1915
|
+
declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
|
|
1916
|
+
|
|
1917
|
+
interface CargoData {
|
|
1918
|
+
cargo: EntityInventory[];
|
|
1919
|
+
}
|
|
1920
|
+
declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
|
|
1921
|
+
declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
|
|
1922
|
+
declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
|
|
1923
|
+
declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
|
|
1924
|
+
declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
|
|
1925
|
+
declare function afterRemoveItems(cargo: Types.cargo_item[], goodsToRemove: Array<{
|
|
1926
|
+
goodId: number;
|
|
2605
1927
|
quantity: number;
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
declare
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
declare
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
1928
|
+
}>): EntityInventory[];
|
|
1929
|
+
declare function afterRemoveAllItems(cargo: Types.cargo_item[]): EntityInventory[];
|
|
1930
|
+
|
|
1931
|
+
type cargoUtils_CargoData = CargoData;
|
|
1932
|
+
declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
|
|
1933
|
+
declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
|
|
1934
|
+
declare const cargoUtils_hasSpace: typeof hasSpace;
|
|
1935
|
+
declare const cargoUtils_availableCapacity: typeof availableCapacity;
|
|
1936
|
+
declare const cargoUtils_isFull: typeof isFull;
|
|
1937
|
+
declare const cargoUtils_afterRemoveItems: typeof afterRemoveItems;
|
|
1938
|
+
declare const cargoUtils_afterRemoveAllItems: typeof afterRemoveAllItems;
|
|
1939
|
+
declare namespace cargoUtils {
|
|
1940
|
+
export {
|
|
1941
|
+
cargoUtils_CargoData as CargoData,
|
|
1942
|
+
cargoUtils_totalCargoMass as totalCargoMass,
|
|
1943
|
+
cargoUtils_getCargoForItem as getCargoForItem,
|
|
1944
|
+
cargoUtils_hasSpace as hasSpace,
|
|
1945
|
+
cargoUtils_availableCapacity as availableCapacity,
|
|
1946
|
+
cargoUtils_isFull as isFull,
|
|
1947
|
+
cargoUtils_afterRemoveItems as afterRemoveItems,
|
|
1948
|
+
cargoUtils_afterRemoveAllItems as afterRemoveAllItems,
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
2622
1951
|
|
|
2623
1952
|
interface Entity {
|
|
2624
1953
|
id: UInt64;
|
|
@@ -2628,7 +1957,6 @@ interface Entity {
|
|
|
2628
1957
|
location: Coordinates | Types.coordinates;
|
|
2629
1958
|
}
|
|
2630
1959
|
type ShipEntity = Entity & MovementCapability & EnergyCapability & StorageCapability & LoaderCapability & MassCapability & ScheduleCapability & {
|
|
2631
|
-
trade?: Types.trade_stats;
|
|
2632
1960
|
extractor?: Types.extractor_stats;
|
|
2633
1961
|
};
|
|
2634
1962
|
type WarehouseEntity = Entity & StorageCapability & LoaderCapability & ScheduleCapability;
|
|
@@ -2639,7 +1967,6 @@ declare function canMove(e: Entity): e is Entity & MovementCapability & EnergyCa
|
|
|
2639
1967
|
declare function hasEnergy(e: Entity): e is Entity & EnergyCapability;
|
|
2640
1968
|
declare function hasStorage(e: Entity): e is Entity & StorageCapability;
|
|
2641
1969
|
declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
|
|
2642
|
-
declare function hasTrade(e: Entity): e is Entity & TradeCapability;
|
|
2643
1970
|
declare function hasMass(e: Entity): e is Entity & MassCapability;
|
|
2644
1971
|
declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
|
|
2645
1972
|
declare function hasExtractor(e: Entity): e is Entity & ExtractorCapability;
|
|
@@ -2654,6 +1981,65 @@ declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64):
|
|
|
2654
1981
|
declare function calc_extraction_duration(extractor: Types.extractor_stats, cargoMass: number, stratum: number, richness: number): UInt32;
|
|
2655
1982
|
declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
|
|
2656
1983
|
|
|
1984
|
+
interface CrafterCapability {
|
|
1985
|
+
crafter: Types.crafter_stats;
|
|
1986
|
+
}
|
|
1987
|
+
declare function capsHasCrafter(caps: EntityCapabilities): boolean;
|
|
1988
|
+
|
|
1989
|
+
declare const ITEM_HULL_PLATES = 10001;
|
|
1990
|
+
declare const ITEM_CARGO_LINING = 10002;
|
|
1991
|
+
declare const ITEM_CONTAINER_PACKED = 10003;
|
|
1992
|
+
interface RecipeInput {
|
|
1993
|
+
category?: ResourceCategory;
|
|
1994
|
+
itemId?: number;
|
|
1995
|
+
quantity: number;
|
|
1996
|
+
}
|
|
1997
|
+
interface ComponentStat {
|
|
1998
|
+
key: string;
|
|
1999
|
+
source: ResourceCategory;
|
|
2000
|
+
}
|
|
2001
|
+
interface ComponentDefinition {
|
|
2002
|
+
id: number;
|
|
2003
|
+
name: string;
|
|
2004
|
+
description: string;
|
|
2005
|
+
color: string;
|
|
2006
|
+
mass: number;
|
|
2007
|
+
stats: ComponentStat[];
|
|
2008
|
+
recipe: RecipeInput[];
|
|
2009
|
+
usedIn: {
|
|
2010
|
+
type: 'entity';
|
|
2011
|
+
name: string;
|
|
2012
|
+
}[];
|
|
2013
|
+
}
|
|
2014
|
+
interface EntityRecipe {
|
|
2015
|
+
id: string;
|
|
2016
|
+
name: string;
|
|
2017
|
+
description: string;
|
|
2018
|
+
color: string;
|
|
2019
|
+
packedItemId: number;
|
|
2020
|
+
recipe: RecipeInput[];
|
|
2021
|
+
stats: {
|
|
2022
|
+
key: string;
|
|
2023
|
+
sourceComponentId: number;
|
|
2024
|
+
sourceStatKey: string;
|
|
2025
|
+
}[];
|
|
2026
|
+
}
|
|
2027
|
+
interface CraftableItem {
|
|
2028
|
+
type: 'component' | 'entity';
|
|
2029
|
+
id: number | string;
|
|
2030
|
+
name: string;
|
|
2031
|
+
description: string;
|
|
2032
|
+
color: string;
|
|
2033
|
+
}
|
|
2034
|
+
declare const components: ComponentDefinition[];
|
|
2035
|
+
declare const entityRecipes: EntityRecipe[];
|
|
2036
|
+
declare function getComponentById(id: number): ComponentDefinition | undefined;
|
|
2037
|
+
declare function getEntityRecipe(id: string): EntityRecipe | undefined;
|
|
2038
|
+
declare function getEntityRecipeByItemId(itemId: number): EntityRecipe | undefined;
|
|
2039
|
+
declare function getAllCraftableItems(): CraftableItem[];
|
|
2040
|
+
declare function getComponentsForCategory(category: ResourceCategory): ComponentDefinition[];
|
|
2041
|
+
declare function getComponentsForStat(statKey: string): ComponentDefinition[];
|
|
2042
|
+
|
|
2657
2043
|
type movement_stats = Types.movement_stats;
|
|
2658
2044
|
type energy_stats = Types.energy_stats;
|
|
2659
2045
|
type loader_stats = Types.loader_stats;
|
|
@@ -2667,4 +2053,4 @@ type location_epoch = Types.location_epoch;
|
|
|
2667
2053
|
type location_derived = Types.location_derived;
|
|
2668
2054
|
type location_row = Types.location_row;
|
|
2669
2055
|
|
|
2670
|
-
export { ActionsManager, AnyEntity,
|
|
2056
|
+
export { ActionsManager, AnyEntity, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, 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, ExtractorCapability, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_EXTRACTOR_DRAIN, INITIAL_EXTRACTOR_EFFICIENCY, INITIAL_EXTRACTOR_RATE, INITIAL_LOADER_MASS, INITIAL_LOADER_QUANTITY, INITIAL_LOADER_THRUST, INITIAL_SHIP_CAPACITY, INITIAL_SHIP_DRAIN, INITIAL_SHIP_ENERGY, INITIAL_SHIP_GENERATOR_CAPACITY, INITIAL_SHIP_HULLMASS, INITIAL_SHIP_MASS, INITIAL_SHIP_RECHARGE, INITIAL_SHIP_THRUST, INITIAL_SHIP_Z, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_LINING, ITEM_CONTAINER_PACKED, ITEM_DOES_NOT_EXIST, ITEM_HULL_PLATES, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, 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, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RecipeInput, 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, ShipEntity, ShipLike, ShipStateInput, Shipload, StackInput, StatDefinition, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendComponentStacks, blendStacks, calcCargoMass, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, 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, capsHasCrafter, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoUtils, cargo_item, components, computeComponentStats, computeContainerCapabilities, computeEntityStats, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStats, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, encodeStats, energyPercent, energy_stats, entityRecipes, estimateDealTravelTime, estimateTravelTime, extractor_stats, findNearbyPlanets, getAllCraftableItems, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, maxTravelDistance, movement_stats, needsRecharge, projectEntity, projectEntityAt, resolveStats, rotation, schedule, task, toLocation, warehouse_row };
|