@shipload/sdk 2.0.0-rc2 → 2.0.0-rc3
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 +271 -137
- package/lib/shipload.js +1375 -1022
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +780 -342
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/extraction.ts +14 -21
- package/src/capabilities/storage.ts +2 -2
- package/src/contracts/server.ts +239 -120
- package/src/data/items.json +16 -0
- package/src/derivation/index.ts +25 -0
- package/src/derivation/location-size.ts +15 -0
- package/src/derivation/resources.ts +141 -0
- package/src/derivation/stratum.ts +116 -0
- package/src/entities/cargo-utils.ts +8 -8
- package/src/entities/entity-inventory.ts +13 -9
- package/src/entities/inventory-accessor.ts +2 -2
- package/src/entities/location.ts +10 -10
- package/src/entities/ship.ts +10 -6
- package/src/entities/warehouse.ts +2 -2
- package/src/errors.ts +4 -4
- package/src/index-module.ts +31 -6
- package/src/managers/actions.ts +21 -9
- package/src/managers/locations.ts +7 -7
- package/src/managers/trades.ts +5 -5
- package/src/market/items.ts +31 -0
- package/src/market/market.ts +9 -9
- package/src/scheduling/projection.ts +7 -7
- package/src/trading/collect.ts +25 -25
- package/src/trading/deal.ts +8 -8
- package/src/trading/trade.ts +9 -9
- package/src/travel/travel.ts +6 -6
- package/src/types.ts +17 -7
- package/src/utils/system.ts +7 -42
- package/src/data/goods.json +0 -23
- package/src/market/goods.ts +0 -31
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, UInt16, UInt8, TimePoint, Int64, UInt8Type, TimePointType,
|
|
2
|
+
import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt16, UInt8, TimePoint, 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';
|
|
@@ -167,10 +167,10 @@ declare namespace Types {
|
|
|
167
167
|
ship_id: UInt64;
|
|
168
168
|
name: string;
|
|
169
169
|
}
|
|
170
|
-
class
|
|
170
|
+
class buyitems extends Struct {
|
|
171
171
|
entity_type: Name;
|
|
172
172
|
id: UInt64;
|
|
173
|
-
|
|
173
|
+
item_id: UInt16;
|
|
174
174
|
quantity: UInt32;
|
|
175
175
|
}
|
|
176
176
|
class buyship extends Struct {
|
|
@@ -199,25 +199,23 @@ declare namespace Types {
|
|
|
199
199
|
entitygroup?: UInt64;
|
|
200
200
|
group_members?: entity_ref[];
|
|
201
201
|
}
|
|
202
|
-
class mixture_component extends Struct {
|
|
203
|
-
good_id: UInt16;
|
|
204
|
-
purity: UInt16;
|
|
205
|
-
}
|
|
206
|
-
class mixture_info extends Struct {
|
|
207
|
-
components: mixture_component[];
|
|
208
|
-
}
|
|
209
202
|
class cargo_item extends Struct {
|
|
210
|
-
|
|
203
|
+
item_id: UInt16;
|
|
211
204
|
quantity: UInt32;
|
|
212
205
|
unit_cost: UInt64;
|
|
213
|
-
|
|
206
|
+
seed?: UInt64;
|
|
214
207
|
}
|
|
215
208
|
class cargo_row extends Struct {
|
|
216
209
|
id: UInt64;
|
|
217
210
|
entity_id: UInt64;
|
|
218
|
-
|
|
211
|
+
item_id: UInt64;
|
|
219
212
|
quantity: UInt64;
|
|
220
213
|
unit_cost: UInt64;
|
|
214
|
+
seed: UInt64;
|
|
215
|
+
}
|
|
216
|
+
class cleanrsvp extends Struct {
|
|
217
|
+
epoch: UInt64;
|
|
218
|
+
max_rows: UInt64;
|
|
221
219
|
}
|
|
222
220
|
class cleartable extends Struct {
|
|
223
221
|
table_name: Name;
|
|
@@ -227,6 +225,62 @@ declare namespace Types {
|
|
|
227
225
|
class commit extends Struct {
|
|
228
226
|
commit: Checksum256;
|
|
229
227
|
}
|
|
228
|
+
class movement_stats extends Struct {
|
|
229
|
+
thrust: UInt32;
|
|
230
|
+
drain: UInt16;
|
|
231
|
+
}
|
|
232
|
+
class energy_stats extends Struct {
|
|
233
|
+
capacity: UInt16;
|
|
234
|
+
recharge: UInt16;
|
|
235
|
+
}
|
|
236
|
+
class loader_stats extends Struct {
|
|
237
|
+
mass: UInt32;
|
|
238
|
+
thrust: UInt16;
|
|
239
|
+
quantity: UInt8;
|
|
240
|
+
}
|
|
241
|
+
class trade_stats extends Struct {
|
|
242
|
+
margin: UInt16;
|
|
243
|
+
}
|
|
244
|
+
class extractor_stats extends Struct {
|
|
245
|
+
rate: UInt16;
|
|
246
|
+
drain: UInt16;
|
|
247
|
+
efficiency: UInt16;
|
|
248
|
+
depth: UInt16;
|
|
249
|
+
drill: UInt16;
|
|
250
|
+
}
|
|
251
|
+
class warp_stats extends Struct {
|
|
252
|
+
range: UInt32;
|
|
253
|
+
}
|
|
254
|
+
class entity_defaults extends Struct {
|
|
255
|
+
ship_hullmass: UInt32;
|
|
256
|
+
ship_capacity: UInt32;
|
|
257
|
+
ship_energy: UInt16;
|
|
258
|
+
ship_z: UInt16;
|
|
259
|
+
ship_engines: movement_stats;
|
|
260
|
+
ship_generator: energy_stats;
|
|
261
|
+
ship_loaders: loader_stats;
|
|
262
|
+
ship_trade: trade_stats;
|
|
263
|
+
ship_extractor: extractor_stats;
|
|
264
|
+
warehouse_capacity: UInt32;
|
|
265
|
+
warehouse_z: UInt16;
|
|
266
|
+
warehouse_loaders: loader_stats;
|
|
267
|
+
container_hullmass: UInt32;
|
|
268
|
+
container_capacity: UInt32;
|
|
269
|
+
container_z: UInt16;
|
|
270
|
+
}
|
|
271
|
+
class item_def extends Struct {
|
|
272
|
+
id: UInt16;
|
|
273
|
+
base_price: UInt32;
|
|
274
|
+
mass: UInt32;
|
|
275
|
+
}
|
|
276
|
+
class game_config extends Struct {
|
|
277
|
+
version: UInt32;
|
|
278
|
+
defaults: entity_defaults;
|
|
279
|
+
items: item_def[];
|
|
280
|
+
}
|
|
281
|
+
class configlog extends Struct {
|
|
282
|
+
config: game_config;
|
|
283
|
+
}
|
|
230
284
|
class coordinates extends Struct {
|
|
231
285
|
x: Int64;
|
|
232
286
|
y: Int64;
|
|
@@ -260,28 +314,10 @@ declare namespace Types {
|
|
|
260
314
|
class enable extends Struct {
|
|
261
315
|
enabled: boolean;
|
|
262
316
|
}
|
|
263
|
-
class energy_stats extends Struct {
|
|
264
|
-
capacity: UInt16;
|
|
265
|
-
recharge: UInt16;
|
|
266
|
-
}
|
|
267
317
|
class entity_current_state extends Struct {
|
|
268
318
|
coordinates: coordinates;
|
|
269
319
|
energy: UInt16;
|
|
270
320
|
}
|
|
271
|
-
class loader_stats extends Struct {
|
|
272
|
-
mass: UInt32;
|
|
273
|
-
thrust: UInt16;
|
|
274
|
-
quantity: UInt8;
|
|
275
|
-
}
|
|
276
|
-
class movement_stats extends Struct {
|
|
277
|
-
thrust: UInt32;
|
|
278
|
-
drain: UInt16;
|
|
279
|
-
}
|
|
280
|
-
class extractor_stats extends Struct {
|
|
281
|
-
rate: UInt16;
|
|
282
|
-
drain: UInt16;
|
|
283
|
-
efficiency: UInt16;
|
|
284
|
-
}
|
|
285
321
|
class entity_info extends Struct {
|
|
286
322
|
type: Name;
|
|
287
323
|
id: UInt64;
|
|
@@ -297,6 +333,7 @@ declare namespace Types {
|
|
|
297
333
|
generator?: energy_stats;
|
|
298
334
|
capacity?: UInt32;
|
|
299
335
|
extractor?: extractor_stats;
|
|
336
|
+
warp?: warp_stats;
|
|
300
337
|
is_idle: boolean;
|
|
301
338
|
current_task?: task;
|
|
302
339
|
current_task_elapsed: UInt32;
|
|
@@ -326,7 +363,12 @@ declare namespace Types {
|
|
|
326
363
|
participants: entity_ref[];
|
|
327
364
|
}
|
|
328
365
|
class extract extends Struct {
|
|
329
|
-
|
|
366
|
+
entity_type: Name;
|
|
367
|
+
id: UInt64;
|
|
368
|
+
stratum: UInt16;
|
|
369
|
+
quantity: UInt32;
|
|
370
|
+
}
|
|
371
|
+
class getconfig extends Struct {
|
|
330
372
|
}
|
|
331
373
|
class getentities extends Struct {
|
|
332
374
|
owner: Name;
|
|
@@ -336,7 +378,7 @@ declare namespace Types {
|
|
|
336
378
|
entity_type: Name;
|
|
337
379
|
entity_id: UInt64;
|
|
338
380
|
}
|
|
339
|
-
class
|
|
381
|
+
class getitems extends Struct {
|
|
340
382
|
}
|
|
341
383
|
class getlocation extends Struct {
|
|
342
384
|
x: Int64;
|
|
@@ -360,14 +402,6 @@ declare namespace Types {
|
|
|
360
402
|
owner: Name;
|
|
361
403
|
entity_type?: Name;
|
|
362
404
|
}
|
|
363
|
-
class good extends Struct {
|
|
364
|
-
id: UInt16;
|
|
365
|
-
base_price: UInt32;
|
|
366
|
-
mass: UInt32;
|
|
367
|
-
}
|
|
368
|
-
class goods_info extends Struct {
|
|
369
|
-
goods: good[];
|
|
370
|
-
}
|
|
371
405
|
class grouptravel extends Struct {
|
|
372
406
|
entities: entity_ref[];
|
|
373
407
|
x: Int64;
|
|
@@ -383,6 +417,9 @@ declare namespace Types {
|
|
|
383
417
|
class init extends Struct {
|
|
384
418
|
seed: Checksum256;
|
|
385
419
|
}
|
|
420
|
+
class items_info extends Struct {
|
|
421
|
+
items: item_def[];
|
|
422
|
+
}
|
|
386
423
|
class join extends Struct {
|
|
387
424
|
account: Name;
|
|
388
425
|
}
|
|
@@ -402,7 +439,7 @@ declare namespace Types {
|
|
|
402
439
|
static_props: location_static;
|
|
403
440
|
epoch_props: location_epoch;
|
|
404
441
|
}
|
|
405
|
-
class
|
|
442
|
+
class location_item extends Struct {
|
|
406
443
|
id: UInt16;
|
|
407
444
|
price: UInt32;
|
|
408
445
|
supply: UInt16;
|
|
@@ -412,7 +449,7 @@ declare namespace Types {
|
|
|
412
449
|
class location_info extends Struct {
|
|
413
450
|
coords: coordinates;
|
|
414
451
|
is_system: boolean;
|
|
415
|
-
|
|
452
|
+
items: location_item[];
|
|
416
453
|
}
|
|
417
454
|
class location_row extends Struct {
|
|
418
455
|
id: UInt64;
|
|
@@ -445,11 +482,6 @@ declare namespace Types {
|
|
|
445
482
|
starts_at: TimePoint;
|
|
446
483
|
completes_at: TimePoint;
|
|
447
484
|
new_energy?: UInt16;
|
|
448
|
-
new_coordinates?: coordinates;
|
|
449
|
-
cargomass_delta: Int64;
|
|
450
|
-
cargo_added: cargo_item[];
|
|
451
|
-
cargo_removed: cargo_item[];
|
|
452
|
-
credits?: Int64;
|
|
453
485
|
}
|
|
454
486
|
class notify extends Struct {
|
|
455
487
|
event: task_event;
|
|
@@ -486,6 +518,10 @@ declare namespace Types {
|
|
|
486
518
|
entity_type: Name;
|
|
487
519
|
id: UInt64;
|
|
488
520
|
}
|
|
521
|
+
class reserve_row extends Struct {
|
|
522
|
+
id: UInt64;
|
|
523
|
+
remaining: UInt32;
|
|
524
|
+
}
|
|
489
525
|
class resolve extends Struct {
|
|
490
526
|
entity_type: Name;
|
|
491
527
|
id: UInt64;
|
|
@@ -502,19 +538,16 @@ declare namespace Types {
|
|
|
502
538
|
class salt extends Struct {
|
|
503
539
|
salt: UInt64;
|
|
504
540
|
}
|
|
505
|
-
class
|
|
541
|
+
class sellitems extends Struct {
|
|
506
542
|
entity_type: Name;
|
|
507
543
|
id: UInt64;
|
|
508
|
-
|
|
544
|
+
item_id: UInt16;
|
|
509
545
|
quantity: UInt32;
|
|
510
546
|
}
|
|
511
547
|
class sequence_row extends Struct {
|
|
512
548
|
key: Name;
|
|
513
549
|
value: UInt64;
|
|
514
550
|
}
|
|
515
|
-
class trade_stats extends Struct {
|
|
516
|
-
margin: UInt16;
|
|
517
|
-
}
|
|
518
551
|
class ship_row extends Struct {
|
|
519
552
|
id: UInt64;
|
|
520
553
|
owner: Name;
|
|
@@ -529,6 +562,7 @@ declare namespace Types {
|
|
|
529
562
|
loaders: loader_stats;
|
|
530
563
|
trade?: trade_stats;
|
|
531
564
|
extractor?: extractor_stats;
|
|
565
|
+
warp?: warp_stats;
|
|
532
566
|
schedule?: schedule;
|
|
533
567
|
}
|
|
534
568
|
class starter_info extends Struct {
|
|
@@ -548,7 +582,7 @@ declare namespace Types {
|
|
|
548
582
|
id: UInt64;
|
|
549
583
|
coordinates: coordinates;
|
|
550
584
|
epoch: UInt64;
|
|
551
|
-
|
|
585
|
+
item_id: UInt16;
|
|
552
586
|
supply: UInt16;
|
|
553
587
|
}
|
|
554
588
|
class takeloan extends Struct {
|
|
@@ -563,7 +597,7 @@ declare namespace Types {
|
|
|
563
597
|
source_id: UInt64;
|
|
564
598
|
dest_type: Name;
|
|
565
599
|
dest_id: UInt64;
|
|
566
|
-
|
|
600
|
+
item_id: UInt16;
|
|
567
601
|
quantity: UInt32;
|
|
568
602
|
}
|
|
569
603
|
class travel extends Struct {
|
|
@@ -577,6 +611,7 @@ declare namespace Types {
|
|
|
577
611
|
id: UInt64;
|
|
578
612
|
entity_summary_type: entity_summary;
|
|
579
613
|
starter_info_type: starter_info;
|
|
614
|
+
game_config_type: game_config;
|
|
580
615
|
}
|
|
581
616
|
class updatecredit extends Struct {
|
|
582
617
|
account: Name;
|
|
@@ -607,6 +642,7 @@ declare const TableMap: {
|
|
|
607
642
|
entitygroup: typeof Types.entitygroup_row;
|
|
608
643
|
location: typeof Types.location_row;
|
|
609
644
|
player: typeof Types.player_row;
|
|
645
|
+
reserve: typeof Types.reserve_row;
|
|
610
646
|
sequence: typeof Types.sequence_row;
|
|
611
647
|
ship: typeof Types.ship_row;
|
|
612
648
|
state: typeof Types.state_row;
|
|
@@ -620,6 +656,7 @@ interface TableTypes {
|
|
|
620
656
|
entitygroup: Types.entitygroup_row;
|
|
621
657
|
location: Types.location_row;
|
|
622
658
|
player: Types.player_row;
|
|
659
|
+
reserve: Types.reserve_row;
|
|
623
660
|
sequence: Types.sequence_row;
|
|
624
661
|
ship: Types.ship_row;
|
|
625
662
|
state: Types.state_row;
|
|
@@ -631,6 +668,56 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
|
|
|
631
668
|
type TableNames = keyof TableTypes;
|
|
632
669
|
declare namespace ActionParams {
|
|
633
670
|
namespace Type {
|
|
671
|
+
interface game_config {
|
|
672
|
+
version: UInt32Type;
|
|
673
|
+
defaults: Type.entity_defaults;
|
|
674
|
+
items: Type.item_def[];
|
|
675
|
+
}
|
|
676
|
+
interface entity_defaults {
|
|
677
|
+
ship_hullmass: UInt32Type;
|
|
678
|
+
ship_capacity: UInt32Type;
|
|
679
|
+
ship_energy: UInt16Type;
|
|
680
|
+
ship_z: UInt16Type;
|
|
681
|
+
ship_engines: Type.movement_stats;
|
|
682
|
+
ship_generator: Type.energy_stats;
|
|
683
|
+
ship_loaders: Type.loader_stats;
|
|
684
|
+
ship_trade: Type.trade_stats;
|
|
685
|
+
ship_extractor: Type.extractor_stats;
|
|
686
|
+
warehouse_capacity: UInt32Type;
|
|
687
|
+
warehouse_z: UInt16Type;
|
|
688
|
+
warehouse_loaders: Type.loader_stats;
|
|
689
|
+
container_hullmass: UInt32Type;
|
|
690
|
+
container_capacity: UInt32Type;
|
|
691
|
+
container_z: UInt16Type;
|
|
692
|
+
}
|
|
693
|
+
interface movement_stats {
|
|
694
|
+
thrust: UInt32Type;
|
|
695
|
+
drain: UInt16Type;
|
|
696
|
+
}
|
|
697
|
+
interface energy_stats {
|
|
698
|
+
capacity: UInt16Type;
|
|
699
|
+
recharge: UInt16Type;
|
|
700
|
+
}
|
|
701
|
+
interface loader_stats {
|
|
702
|
+
mass: UInt32Type;
|
|
703
|
+
thrust: UInt16Type;
|
|
704
|
+
quantity: UInt8Type;
|
|
705
|
+
}
|
|
706
|
+
interface trade_stats {
|
|
707
|
+
margin: UInt16Type;
|
|
708
|
+
}
|
|
709
|
+
interface extractor_stats {
|
|
710
|
+
rate: UInt16Type;
|
|
711
|
+
drain: UInt16Type;
|
|
712
|
+
efficiency: UInt16Type;
|
|
713
|
+
depth: UInt16Type;
|
|
714
|
+
drill: UInt16Type;
|
|
715
|
+
}
|
|
716
|
+
interface item_def {
|
|
717
|
+
id: UInt16Type;
|
|
718
|
+
base_price: UInt32Type;
|
|
719
|
+
mass: UInt32Type;
|
|
720
|
+
}
|
|
634
721
|
interface entity_ref {
|
|
635
722
|
entity_type: NameType;
|
|
636
723
|
entity_id: UInt64Type;
|
|
@@ -645,11 +732,6 @@ declare namespace ActionParams {
|
|
|
645
732
|
starts_at: TimePointType;
|
|
646
733
|
completes_at: TimePointType;
|
|
647
734
|
new_energy?: UInt16Type;
|
|
648
|
-
new_coordinates?: Type.coordinates;
|
|
649
|
-
cargomass_delta: Int64Type;
|
|
650
|
-
cargo_added: Type.cargo_item[];
|
|
651
|
-
cargo_removed: Type.cargo_item[];
|
|
652
|
-
credits?: Int64Type;
|
|
653
735
|
}
|
|
654
736
|
interface task {
|
|
655
737
|
type: UInt8Type;
|
|
@@ -668,17 +750,10 @@ declare namespace ActionParams {
|
|
|
668
750
|
z?: UInt16Type;
|
|
669
751
|
}
|
|
670
752
|
interface cargo_item {
|
|
671
|
-
|
|
753
|
+
item_id: UInt16Type;
|
|
672
754
|
quantity: UInt32Type;
|
|
673
755
|
unit_cost: UInt64Type;
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
interface mixture_info {
|
|
677
|
-
components: Type.mixture_component[];
|
|
678
|
-
}
|
|
679
|
-
interface mixture_component {
|
|
680
|
-
good_id: UInt16Type;
|
|
681
|
-
purity: UInt16Type;
|
|
756
|
+
seed?: UInt64Type;
|
|
682
757
|
}
|
|
683
758
|
}
|
|
684
759
|
interface advance {
|
|
@@ -690,10 +765,10 @@ declare namespace ActionParams {
|
|
|
690
765
|
ship_id: UInt64Type;
|
|
691
766
|
name: string;
|
|
692
767
|
}
|
|
693
|
-
interface
|
|
768
|
+
interface buyitems {
|
|
694
769
|
entity_type: NameType;
|
|
695
770
|
id: UInt64Type;
|
|
696
|
-
|
|
771
|
+
item_id: UInt16Type;
|
|
697
772
|
quantity: UInt32Type;
|
|
698
773
|
}
|
|
699
774
|
interface buyship {
|
|
@@ -710,6 +785,10 @@ declare namespace ActionParams {
|
|
|
710
785
|
id: UInt64Type;
|
|
711
786
|
count: UInt64Type;
|
|
712
787
|
}
|
|
788
|
+
interface cleanrsvp {
|
|
789
|
+
epoch: UInt64Type;
|
|
790
|
+
max_rows: UInt64Type;
|
|
791
|
+
}
|
|
713
792
|
interface cleartable {
|
|
714
793
|
table_name: NameType;
|
|
715
794
|
scope?: NameType;
|
|
@@ -718,11 +797,19 @@ declare namespace ActionParams {
|
|
|
718
797
|
interface commit {
|
|
719
798
|
commit: Checksum256Type;
|
|
720
799
|
}
|
|
800
|
+
interface configlog {
|
|
801
|
+
config: Type.game_config;
|
|
802
|
+
}
|
|
721
803
|
interface enable {
|
|
722
804
|
enabled: boolean;
|
|
723
805
|
}
|
|
724
806
|
interface extract {
|
|
725
|
-
|
|
807
|
+
entity_type: NameType;
|
|
808
|
+
id: UInt64Type;
|
|
809
|
+
stratum: UInt16Type;
|
|
810
|
+
quantity: UInt32Type;
|
|
811
|
+
}
|
|
812
|
+
interface getconfig {
|
|
726
813
|
}
|
|
727
814
|
interface getentities {
|
|
728
815
|
owner: NameType;
|
|
@@ -732,7 +819,7 @@ declare namespace ActionParams {
|
|
|
732
819
|
entity_type: NameType;
|
|
733
820
|
entity_id: UInt64Type;
|
|
734
821
|
}
|
|
735
|
-
interface
|
|
822
|
+
interface getitems {
|
|
736
823
|
}
|
|
737
824
|
interface getlocation {
|
|
738
825
|
x: Int64Type;
|
|
@@ -796,10 +883,10 @@ declare namespace ActionParams {
|
|
|
796
883
|
interface salt {
|
|
797
884
|
salt: UInt64Type;
|
|
798
885
|
}
|
|
799
|
-
interface
|
|
886
|
+
interface sellitems {
|
|
800
887
|
entity_type: NameType;
|
|
801
888
|
id: UInt64Type;
|
|
802
|
-
|
|
889
|
+
item_id: UInt16Type;
|
|
803
890
|
quantity: UInt32Type;
|
|
804
891
|
}
|
|
805
892
|
interface takeloan {
|
|
@@ -811,7 +898,7 @@ declare namespace ActionParams {
|
|
|
811
898
|
source_id: UInt64Type;
|
|
812
899
|
dest_type: NameType;
|
|
813
900
|
dest_id: UInt64Type;
|
|
814
|
-
|
|
901
|
+
item_id: UInt16Type;
|
|
815
902
|
quantity: UInt32Type;
|
|
816
903
|
}
|
|
817
904
|
interface travel {
|
|
@@ -837,17 +924,20 @@ declare namespace ActionParams {
|
|
|
837
924
|
interface ActionNameParams {
|
|
838
925
|
advance: ActionParams.advance;
|
|
839
926
|
buycontainer: ActionParams.buycontainer;
|
|
840
|
-
|
|
927
|
+
buyitems: ActionParams.buyitems;
|
|
841
928
|
buyship: ActionParams.buyship;
|
|
842
929
|
buywarehouse: ActionParams.buywarehouse;
|
|
843
930
|
cancel: ActionParams.cancel;
|
|
931
|
+
cleanrsvp: ActionParams.cleanrsvp;
|
|
844
932
|
cleartable: ActionParams.cleartable;
|
|
845
933
|
commit: ActionParams.commit;
|
|
934
|
+
configlog: ActionParams.configlog;
|
|
846
935
|
enable: ActionParams.enable;
|
|
847
936
|
extract: ActionParams.extract;
|
|
937
|
+
getconfig: ActionParams.getconfig;
|
|
848
938
|
getentities: ActionParams.getentities;
|
|
849
939
|
getentity: ActionParams.getentity;
|
|
850
|
-
|
|
940
|
+
getitems: ActionParams.getitems;
|
|
851
941
|
getlocation: ActionParams.getlocation;
|
|
852
942
|
getlocdata: ActionParams.getlocdata;
|
|
853
943
|
getnearby: ActionParams.getnearby;
|
|
@@ -865,7 +955,7 @@ interface ActionNameParams {
|
|
|
865
955
|
recharge: ActionParams.recharge;
|
|
866
956
|
resolve: ActionParams.resolve;
|
|
867
957
|
salt: ActionParams.salt;
|
|
868
|
-
|
|
958
|
+
sellitems: ActionParams.sellitems;
|
|
869
959
|
takeloan: ActionParams.takeloan;
|
|
870
960
|
transfer: ActionParams.transfer;
|
|
871
961
|
travel: ActionParams.travel;
|
|
@@ -876,12 +966,13 @@ interface ActionNameParams {
|
|
|
876
966
|
}
|
|
877
967
|
type ActionNames = keyof ActionNameParams;
|
|
878
968
|
interface ActionReturnValues {
|
|
879
|
-
|
|
969
|
+
buyitems: Types.task_results;
|
|
880
970
|
cancel: Types.cancel_results;
|
|
881
971
|
extract: Types.task_results;
|
|
972
|
+
getconfig: Types.game_config;
|
|
882
973
|
getentities: Types.entity_info[];
|
|
883
974
|
getentity: Types.entity_info;
|
|
884
|
-
|
|
975
|
+
getitems: Types.items_info;
|
|
885
976
|
getlocation: Types.location_info;
|
|
886
977
|
getlocdata: Types.location_derived;
|
|
887
978
|
getnearby: Types.nearby_info;
|
|
@@ -893,7 +984,7 @@ interface ActionReturnValues {
|
|
|
893
984
|
hash512: Checksum512;
|
|
894
985
|
recharge: Types.task_results;
|
|
895
986
|
resolve: Types.resolve_results;
|
|
896
|
-
|
|
987
|
+
sellitems: Types.task_results;
|
|
897
988
|
transfer: Types.task_results;
|
|
898
989
|
travel: Types.task_results;
|
|
899
990
|
}
|
|
@@ -948,11 +1039,11 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
|
|
|
948
1039
|
declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
|
|
949
1040
|
declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
|
|
950
1041
|
declare const GAME_SEED_NOT_SET = "This game has not initialized an epoch seed value.";
|
|
951
|
-
declare const
|
|
952
|
-
declare const
|
|
1042
|
+
declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
|
|
1043
|
+
declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
|
|
953
1044
|
declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
|
|
954
|
-
declare const
|
|
955
|
-
declare const
|
|
1045
|
+
declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
|
|
1046
|
+
declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
|
|
956
1047
|
declare const INVALID_AMOUNT = "Invalid amount.";
|
|
957
1048
|
declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
|
|
958
1049
|
declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
|
|
@@ -1015,7 +1106,7 @@ interface ShipLike {
|
|
|
1015
1106
|
capacity: UInt32;
|
|
1016
1107
|
}
|
|
1017
1108
|
interface CargoMassInfo {
|
|
1018
|
-
|
|
1109
|
+
item_id: UInt16Type;
|
|
1019
1110
|
quantity: UInt32Type;
|
|
1020
1111
|
}
|
|
1021
1112
|
declare enum TaskType {
|
|
@@ -1024,7 +1115,8 @@ declare enum TaskType {
|
|
|
1024
1115
|
RECHARGE = 2,
|
|
1025
1116
|
LOAD = 3,
|
|
1026
1117
|
UNLOAD = 4,
|
|
1027
|
-
EXTRACT = 5
|
|
1118
|
+
EXTRACT = 5,
|
|
1119
|
+
WARP = 6
|
|
1028
1120
|
}
|
|
1029
1121
|
declare enum LocationType {
|
|
1030
1122
|
EMPTY = 0,
|
|
@@ -1058,16 +1150,21 @@ interface Distance {
|
|
|
1058
1150
|
destination: ActionParams.Type.coordinates;
|
|
1059
1151
|
distance: UInt16;
|
|
1060
1152
|
}
|
|
1061
|
-
|
|
1153
|
+
type ResourceCategory = 'metal' | 'gas' | 'mineral' | 'organic';
|
|
1154
|
+
type ResourceRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
|
|
1155
|
+
declare class Item extends Struct {
|
|
1062
1156
|
id: UInt16;
|
|
1063
1157
|
name: string;
|
|
1064
1158
|
description: string;
|
|
1065
1159
|
base_price: UInt32;
|
|
1066
1160
|
mass: UInt32;
|
|
1161
|
+
category: ResourceCategory;
|
|
1162
|
+
rarity: ResourceRarity;
|
|
1163
|
+
color: string;
|
|
1067
1164
|
}
|
|
1068
|
-
declare class
|
|
1165
|
+
declare class ItemPrice extends Struct {
|
|
1069
1166
|
id: UInt16;
|
|
1070
|
-
|
|
1167
|
+
item: Item;
|
|
1071
1168
|
price: UInt32;
|
|
1072
1169
|
supply: UInt16;
|
|
1073
1170
|
}
|
|
@@ -1323,15 +1420,15 @@ declare class Location {
|
|
|
1323
1420
|
/**
|
|
1324
1421
|
* Set cached market prices for this location
|
|
1325
1422
|
*/
|
|
1326
|
-
setMarketPrices(prices:
|
|
1423
|
+
setMarketPrices(prices: ItemPrice[]): void;
|
|
1327
1424
|
/**
|
|
1328
1425
|
* Get cached market prices (returns undefined if not cached)
|
|
1329
1426
|
*/
|
|
1330
|
-
get marketPrices():
|
|
1427
|
+
get marketPrices(): ItemPrice[] | undefined;
|
|
1331
1428
|
/**
|
|
1332
1429
|
* Get price for a specific good (from cache)
|
|
1333
1430
|
*/
|
|
1334
|
-
getPrice(goodId: UInt16Type):
|
|
1431
|
+
getPrice(goodId: UInt16Type): ItemPrice | undefined;
|
|
1335
1432
|
/**
|
|
1336
1433
|
* Find nearby planets from this location
|
|
1337
1434
|
*/
|
|
@@ -1403,9 +1500,9 @@ declare class Location {
|
|
|
1403
1500
|
declare function toLocation(coords: CoordinatesType | Location): Location;
|
|
1404
1501
|
|
|
1405
1502
|
declare class LocationsManager extends BaseManager {
|
|
1406
|
-
getMarketPrice(location: CoordinatesType, goodId: number): Promise<
|
|
1407
|
-
getMarketPrices(location: CoordinatesType): Promise<
|
|
1408
|
-
getMarketPricesWithSupply(location: CoordinatesType): Promise<
|
|
1503
|
+
getMarketPrice(location: CoordinatesType, goodId: number): Promise<ItemPrice>;
|
|
1504
|
+
getMarketPrices(location: CoordinatesType): Promise<ItemPrice[]>;
|
|
1505
|
+
getMarketPricesWithSupply(location: CoordinatesType): Promise<ItemPrice[]>;
|
|
1409
1506
|
hasSystem(location: CoordinatesType): Promise<boolean>;
|
|
1410
1507
|
findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
|
|
1411
1508
|
getSupplyRows(location: CoordinatesType): Promise<any[]>;
|
|
@@ -1629,8 +1726,9 @@ declare class ScheduleAccessor {
|
|
|
1629
1726
|
declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
|
|
1630
1727
|
|
|
1631
1728
|
declare class EntityInventory extends Types.cargo_item {
|
|
1632
|
-
private
|
|
1633
|
-
get
|
|
1729
|
+
private _item?;
|
|
1730
|
+
get item(): Item;
|
|
1731
|
+
get good(): Item;
|
|
1634
1732
|
get name(): string;
|
|
1635
1733
|
get unitMass(): UInt32;
|
|
1636
1734
|
get totalMass(): UInt64;
|
|
@@ -1664,7 +1762,7 @@ declare class InventoryAccessor {
|
|
|
1664
1762
|
get items(): EntityInventory[];
|
|
1665
1763
|
get totalMass(): UInt64;
|
|
1666
1764
|
get totalValue(): UInt64;
|
|
1667
|
-
|
|
1765
|
+
forItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
1668
1766
|
get sellable(): EntityInventory[];
|
|
1669
1767
|
get hasSellable(): boolean;
|
|
1670
1768
|
get sellableCount(): number;
|
|
@@ -1676,7 +1774,7 @@ interface CargoData {
|
|
|
1676
1774
|
}
|
|
1677
1775
|
declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
|
|
1678
1776
|
declare function cargoValue(cargo: EntityInventory[]): UInt64;
|
|
1679
|
-
declare function
|
|
1777
|
+
declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
|
|
1680
1778
|
declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
|
|
1681
1779
|
declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
|
|
1682
1780
|
declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
|
|
@@ -1687,38 +1785,38 @@ interface SaleValue {
|
|
|
1687
1785
|
}
|
|
1688
1786
|
declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
|
|
1689
1787
|
declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
|
|
1690
|
-
declare function
|
|
1788
|
+
declare function afterSellItems(cargo: Types.cargo_item[], goodsToSell: Array<{
|
|
1691
1789
|
goodId: number;
|
|
1692
1790
|
quantity: number;
|
|
1693
1791
|
}>): EntityInventory[];
|
|
1694
|
-
declare function
|
|
1792
|
+
declare function afterSellAllItems(cargo: Types.cargo_item[]): EntityInventory[];
|
|
1695
1793
|
|
|
1696
1794
|
type cargoUtils_CargoData = CargoData;
|
|
1697
1795
|
declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
|
|
1698
1796
|
declare const cargoUtils_cargoValue: typeof cargoValue;
|
|
1699
|
-
declare const
|
|
1797
|
+
declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
|
|
1700
1798
|
declare const cargoUtils_hasSpace: typeof hasSpace;
|
|
1701
1799
|
declare const cargoUtils_availableCapacity: typeof availableCapacity;
|
|
1702
1800
|
declare const cargoUtils_isFull: typeof isFull;
|
|
1703
1801
|
type cargoUtils_SaleValue = SaleValue;
|
|
1704
1802
|
declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
|
|
1705
1803
|
declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
|
|
1706
|
-
declare const
|
|
1707
|
-
declare const
|
|
1804
|
+
declare const cargoUtils_afterSellItems: typeof afterSellItems;
|
|
1805
|
+
declare const cargoUtils_afterSellAllItems: typeof afterSellAllItems;
|
|
1708
1806
|
declare namespace cargoUtils {
|
|
1709
1807
|
export {
|
|
1710
1808
|
cargoUtils_CargoData as CargoData,
|
|
1711
1809
|
cargoUtils_totalCargoMass as totalCargoMass,
|
|
1712
1810
|
cargoUtils_cargoValue as cargoValue,
|
|
1713
|
-
|
|
1811
|
+
cargoUtils_getCargoForItem as getCargoForItem,
|
|
1714
1812
|
cargoUtils_hasSpace as hasSpace,
|
|
1715
1813
|
cargoUtils_availableCapacity as availableCapacity,
|
|
1716
1814
|
cargoUtils_isFull as isFull,
|
|
1717
1815
|
cargoUtils_SaleValue as SaleValue,
|
|
1718
1816
|
cargoUtils_calculateSaleValue as calculateSaleValue,
|
|
1719
1817
|
cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
|
|
1720
|
-
|
|
1721
|
-
|
|
1818
|
+
cargoUtils_afterSellItems as afterSellItems,
|
|
1819
|
+
cargoUtils_afterSellAllItems as afterSellAllItems,
|
|
1722
1820
|
};
|
|
1723
1821
|
}
|
|
1724
1822
|
|
|
@@ -1758,6 +1856,7 @@ declare class Ship extends Types.entity_info {
|
|
|
1758
1856
|
isUnloading(now: Date): boolean;
|
|
1759
1857
|
isExtracting(now: Date): boolean;
|
|
1760
1858
|
get hasExtractor(): boolean;
|
|
1859
|
+
get hasWarp(): boolean;
|
|
1761
1860
|
project(): ProjectedEntity;
|
|
1762
1861
|
projectAt(now: Date): ProjectedEntity;
|
|
1763
1862
|
get location(): Location;
|
|
@@ -1767,7 +1866,7 @@ declare class Ship extends Types.entity_info {
|
|
|
1767
1866
|
get maxCapacity(): UInt64;
|
|
1768
1867
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
1769
1868
|
get availableCapacity(): UInt64;
|
|
1770
|
-
|
|
1869
|
+
getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
1771
1870
|
get sellableCargo(): EntityInventory[];
|
|
1772
1871
|
get hasSellableCargo(): boolean;
|
|
1773
1872
|
get sellableGoodsCount(): number;
|
|
@@ -1777,11 +1876,11 @@ declare class Ship extends Types.entity_info {
|
|
|
1777
1876
|
hasEnergyFor(distance: UInt64): boolean;
|
|
1778
1877
|
calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
|
|
1779
1878
|
calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
|
|
1780
|
-
|
|
1879
|
+
afterSellItems(goodsToSell: Array<{
|
|
1781
1880
|
goodId: number;
|
|
1782
1881
|
quantity: number;
|
|
1783
1882
|
}>): EntityInventory[];
|
|
1784
|
-
|
|
1883
|
+
afterSellAllItems(): EntityInventory[];
|
|
1785
1884
|
}
|
|
1786
1885
|
|
|
1787
1886
|
/**
|
|
@@ -1873,8 +1972,8 @@ interface Deal {
|
|
|
1873
1972
|
origin: Location;
|
|
1874
1973
|
/** Destination location */
|
|
1875
1974
|
destination: Location;
|
|
1876
|
-
/**
|
|
1877
|
-
|
|
1975
|
+
/** Item to trade */
|
|
1976
|
+
item: ItemPrice;
|
|
1878
1977
|
/** Distance between origin and destination */
|
|
1879
1978
|
distance: UInt64;
|
|
1880
1979
|
/** Available supply at origin */
|
|
@@ -1918,11 +2017,11 @@ interface FindDealsOptions {
|
|
|
1918
2017
|
/**
|
|
1919
2018
|
* Calculate deals for a ship from a specific origin location
|
|
1920
2019
|
*/
|
|
1921
|
-
declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<
|
|
2020
|
+
declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
|
|
1922
2021
|
/**
|
|
1923
2022
|
* Find the single best deal for a ship from a specific origin location
|
|
1924
2023
|
*/
|
|
1925
|
-
declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<
|
|
2024
|
+
declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
|
|
1926
2025
|
|
|
1927
2026
|
/**
|
|
1928
2027
|
* Types of collect actions available to the player
|
|
@@ -1973,7 +2072,7 @@ interface CollectOption {
|
|
|
1973
2072
|
/** Detailed breakdown of travel time components */
|
|
1974
2073
|
travelTimeBreakdown?: EstimatedTravelTime;
|
|
1975
2074
|
/** Info about a discounted good at the destination (for explore options) */
|
|
1976
|
-
discountedGood?:
|
|
2075
|
+
discountedGood?: DiscountedItemInfo;
|
|
1977
2076
|
/** Top potential deals available at destination (for explore options) */
|
|
1978
2077
|
potentialDeals?: PotentialDeal[];
|
|
1979
2078
|
/** Details of cargo being sold (if selling cargo) */
|
|
@@ -2086,7 +2185,7 @@ interface CargoSaleItem {
|
|
|
2086
2185
|
/**
|
|
2087
2186
|
* Info about a discounted good for explore options
|
|
2088
2187
|
*/
|
|
2089
|
-
interface
|
|
2188
|
+
interface DiscountedItemInfo {
|
|
2090
2189
|
goodId: number;
|
|
2091
2190
|
name: string;
|
|
2092
2191
|
rarity: string;
|
|
@@ -2105,13 +2204,13 @@ interface PotentialDeal {
|
|
|
2105
2204
|
/**
|
|
2106
2205
|
* Create an "Explore" option (travel to find opportunities)
|
|
2107
2206
|
*/
|
|
2108
|
-
declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?:
|
|
2207
|
+
declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedItemInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
|
|
2109
2208
|
/**
|
|
2110
2209
|
* Callbacks for collect analysis (provided by manager)
|
|
2111
2210
|
*/
|
|
2112
2211
|
interface CollectAnalysisCallbacks {
|
|
2113
2212
|
getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
|
|
2114
|
-
getMarketPrices: (location: Coordinates) => Promise<
|
|
2213
|
+
getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>;
|
|
2115
2214
|
getGameSeed?: () => Checksum256Type;
|
|
2116
2215
|
getState?: () => Types.state_row;
|
|
2117
2216
|
}
|
|
@@ -2142,7 +2241,7 @@ declare class EpochsManager extends BaseManager {
|
|
|
2142
2241
|
}
|
|
2143
2242
|
|
|
2144
2243
|
interface SellableCargo {
|
|
2145
|
-
|
|
2244
|
+
item_id: {
|
|
2146
2245
|
toNumber(): number;
|
|
2147
2246
|
} | number;
|
|
2148
2247
|
quantity: {
|
|
@@ -2161,8 +2260,8 @@ declare class ActionsManager extends BaseManager {
|
|
|
2161
2260
|
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2162
2261
|
recharge(shipId: UInt64Type): Action;
|
|
2163
2262
|
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
|
|
2164
|
-
|
|
2165
|
-
|
|
2263
|
+
buyItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2264
|
+
sellItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2166
2265
|
buyShip(account: NameType, name: string): Action;
|
|
2167
2266
|
buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
2168
2267
|
buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
@@ -2171,6 +2270,7 @@ declare class ActionsManager extends BaseManager {
|
|
|
2171
2270
|
foundCompany(account: NameType, name: string): Action;
|
|
2172
2271
|
join(account: NameType): Action;
|
|
2173
2272
|
extract(shipId: UInt64Type): Action;
|
|
2273
|
+
warp(shipId: UInt64Type, destination: CoordinatesType): Action;
|
|
2174
2274
|
joinGame(account: NameType, companyName: string): Action[];
|
|
2175
2275
|
sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
|
|
2176
2276
|
}
|
|
@@ -2241,7 +2341,7 @@ declare class Warehouse extends Types.entity_info {
|
|
|
2241
2341
|
get availableCapacity(): UInt64;
|
|
2242
2342
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
2243
2343
|
get isFull(): boolean;
|
|
2244
|
-
|
|
2344
|
+
getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
2245
2345
|
get orbitalAltitude(): number;
|
|
2246
2346
|
}
|
|
2247
2347
|
|
|
@@ -2323,9 +2423,9 @@ declare function makeShip(state: ShipStateInput): Ship;
|
|
|
2323
2423
|
declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
|
|
2324
2424
|
declare function makeContainer(state: ContainerStateInput): Container;
|
|
2325
2425
|
|
|
2326
|
-
declare const
|
|
2327
|
-
declare function
|
|
2328
|
-
declare function
|
|
2426
|
+
declare const itemIds: UInt16[];
|
|
2427
|
+
declare function getItem(itemId: UInt16Type): Item;
|
|
2428
|
+
declare function getItems(): Item[];
|
|
2329
2429
|
|
|
2330
2430
|
declare enum Rarities {
|
|
2331
2431
|
legendary = "LEGENDARY",
|
|
@@ -2341,8 +2441,8 @@ interface Rarity {
|
|
|
2341
2441
|
maxMultiplier: number;
|
|
2342
2442
|
}
|
|
2343
2443
|
declare function getRarity(gameSeed: Checksum256Type, epochSeed: Checksum256Type, location: CoordinatesType, goodId: UInt16Type): Rarity;
|
|
2344
|
-
declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row):
|
|
2345
|
-
declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row):
|
|
2444
|
+
declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice;
|
|
2445
|
+
declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice[];
|
|
2346
2446
|
|
|
2347
2447
|
declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
|
|
2348
2448
|
declare function isExtractableLocation(locationType: LocationType): boolean;
|
|
@@ -2351,7 +2451,43 @@ declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesTy
|
|
|
2351
2451
|
declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
|
|
2352
2452
|
declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
|
|
2353
2453
|
declare function deriveLocation(gameSeed: Checksum256Type, epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_derived;
|
|
2354
|
-
|
|
2454
|
+
|
|
2455
|
+
interface StratumInfo {
|
|
2456
|
+
itemId: number;
|
|
2457
|
+
seed: bigint;
|
|
2458
|
+
richness: number;
|
|
2459
|
+
reserve: number;
|
|
2460
|
+
}
|
|
2461
|
+
interface ResourceStats {
|
|
2462
|
+
purity: number;
|
|
2463
|
+
density: number;
|
|
2464
|
+
reactivity: number;
|
|
2465
|
+
resonance: number;
|
|
2466
|
+
}
|
|
2467
|
+
declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
|
|
2468
|
+
declare function deriveResourceStats(seed: bigint): ResourceStats;
|
|
2469
|
+
|
|
2470
|
+
declare function deriveLocationSize(loc: Types.location_static): number;
|
|
2471
|
+
|
|
2472
|
+
declare const DEPTH_THRESHOLD_COMMON = 0;
|
|
2473
|
+
declare const DEPTH_THRESHOLD_UNCOMMON = 2000;
|
|
2474
|
+
declare const DEPTH_THRESHOLD_RARE = 10000;
|
|
2475
|
+
declare const DEPTH_THRESHOLD_EPIC = 30000;
|
|
2476
|
+
declare const DEPTH_THRESHOLD_LEGENDARY = 55000;
|
|
2477
|
+
declare const LOCATION_MIN_DEPTH = 500;
|
|
2478
|
+
declare const LOCATION_MAX_DEPTH = 65535;
|
|
2479
|
+
declare const PLANET_SUBTYPE_GAS_GIANT = 0;
|
|
2480
|
+
declare const PLANET_SUBTYPE_ROCKY = 1;
|
|
2481
|
+
declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
|
|
2482
|
+
declare const PLANET_SUBTYPE_ICY = 3;
|
|
2483
|
+
declare const PLANET_SUBTYPE_OCEAN = 4;
|
|
2484
|
+
declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
|
|
2485
|
+
declare function getDepthThreshold(rarity: ResourceRarity): number;
|
|
2486
|
+
declare function getResourceRarity(itemId: number): ResourceRarity;
|
|
2487
|
+
declare function getResourceWeight(itemId: number, stratum: number): number;
|
|
2488
|
+
declare function getLocationCandidates(locationType: number, subtype: number): number[];
|
|
2489
|
+
declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
|
|
2490
|
+
declare function depthScaleFactor(stratum: number): number;
|
|
2355
2491
|
|
|
2356
2492
|
declare function hash(seed: Checksum256Type, string: string): Checksum256;
|
|
2357
2493
|
declare function hash512(seed: Checksum256Type, string: string): Checksum512;
|
|
@@ -2391,7 +2527,7 @@ declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UI
|
|
|
2391
2527
|
* Calculate the maximum quantity of a good a ship can buy
|
|
2392
2528
|
* considering both space and player balance
|
|
2393
2529
|
*/
|
|
2394
|
-
declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice:
|
|
2530
|
+
declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: ItemPrice): TradeCalculation;
|
|
2395
2531
|
/**
|
|
2396
2532
|
* Trade profit calculation result
|
|
2397
2533
|
*/
|
|
@@ -2416,8 +2552,8 @@ declare function calculateProfitPerSecond(profit: Int64Type, travelTimeSeconds:
|
|
|
2416
2552
|
/**
|
|
2417
2553
|
* Find the best good to trade between two locations
|
|
2418
2554
|
*/
|
|
2419
|
-
declare function
|
|
2420
|
-
|
|
2555
|
+
declare function findBestItemToTrade(ship: Ship, player: Player, originPrices: ItemPrice[], destPrices: ItemPrice[], travelTimeSeconds: UInt32Type): {
|
|
2556
|
+
item: ItemPrice;
|
|
2421
2557
|
quantity: number;
|
|
2422
2558
|
profit: number;
|
|
2423
2559
|
profitPerSecond: number;
|
|
@@ -2467,7 +2603,7 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
|
|
|
2467
2603
|
|
|
2468
2604
|
declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
|
|
2469
2605
|
|
|
2470
|
-
declare function calc_extraction_duration(extractor: Types.extractor_stats,
|
|
2606
|
+
declare function calc_extraction_duration(extractor: Types.extractor_stats, cargoMass: number, stratum: number, richness: number): UInt32;
|
|
2471
2607
|
declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
|
|
2472
2608
|
|
|
2473
2609
|
type movement_stats = Types.movement_stats;
|
|
@@ -2478,11 +2614,9 @@ type cargo_item = Types.cargo_item;
|
|
|
2478
2614
|
type warehouse_row = Types.warehouse_row;
|
|
2479
2615
|
type container_row = Types.container_row;
|
|
2480
2616
|
type extractor_stats = Types.extractor_stats;
|
|
2481
|
-
type mixture_info = Types.mixture_info;
|
|
2482
|
-
type mixture_component = Types.mixture_component;
|
|
2483
2617
|
type location_static = Types.location_static;
|
|
2484
2618
|
type location_epoch = Types.location_epoch;
|
|
2485
2619
|
type location_derived = Types.location_derived;
|
|
2486
2620
|
type location_row = Types.location_row;
|
|
2487
2621
|
|
|
2488
|
-
export { ActionsManager, AnyEntity, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, Deal,
|
|
2622
|
+
export { ActionsManager, AnyEntity, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, DEPTH_THRESHOLD_COMMON, DEPTH_THRESHOLD_EPIC, DEPTH_THRESHOLD_LEGENDARY, DEPTH_THRESHOLD_RARE, DEPTH_THRESHOLD_UNCOMMON, Deal, DiscountedItemInfo, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, FindDealsOptions, 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_DOES_NOT_EXIST, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, ItemPrice, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, NO_SCHEDULE, 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, PotentialDeal, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, Rarity, RepositionLocation, ResourceCategory, ResourceRarity, ResourceStats, 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, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TradeCalculation, TradeCapability, TradeProfitResult, TradesManager, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, analyzeCargoSale, analyzeCollectOptions, availableCapacity$1 as availableCapacity, availableCapacityFromMass, calcCargoMass, calcCargoValue, 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, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, canMove, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, capsHasTrade, cargoUtils, cargo_item, container_row, coordsToLocationId, createExploreOption, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, energy_stats, estimateDealTravelTime, estimateTravelTime, extractor_stats, findBestDeal, findBestItemToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getRarity, getResourceRarity, getResourceWeight, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hasTrade, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isProfitable, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, movement_stats, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };
|