@shipload/sdk 2.0.0-rc2 → 2.0.0-rc20
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/README.md +1 -349
- package/lib/shipload.d.ts +1658 -1126
- package/lib/shipload.js +6847 -3082
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +6468 -2793
- package/lib/shipload.m.js.map +1 -1
- package/package.json +6 -4
- package/src/capabilities/crafting.ts +22 -0
- package/src/capabilities/gathering.ts +36 -0
- package/src/capabilities/guards.ts +3 -8
- package/src/capabilities/hauling.ts +22 -0
- package/src/capabilities/index.ts +4 -1
- package/src/capabilities/modules.ts +57 -0
- package/src/capabilities/storage.ts +101 -9
- package/src/contracts/server.ts +717 -293
- package/src/data/capabilities.ts +408 -0
- package/src/data/categories.ts +55 -0
- package/src/data/colors.ts +71 -0
- package/src/data/items.json +17 -0
- package/src/data/locations.ts +53 -0
- package/src/data/nebula-adjectives.json +211 -0
- package/src/data/nebula-nouns.json +151 -0
- package/src/data/recipes.ts +587 -0
- package/src/data/syllables.json +1386 -780
- package/src/data/tiers.ts +45 -0
- package/src/derivation/crafting.ts +287 -0
- package/src/derivation/index.ts +30 -0
- package/src/derivation/location-size.ts +15 -0
- package/src/derivation/resources.ts +136 -0
- package/src/derivation/stats.ts +146 -0
- package/src/derivation/stratum.ts +134 -0
- package/src/derivation/tiers.ts +54 -0
- package/src/entities/cargo-utils.ts +10 -68
- package/src/entities/container.ts +37 -0
- package/src/entities/entity-inventory.ts +13 -13
- package/src/entities/inventory-accessor.ts +2 -6
- package/src/entities/location.ts +5 -200
- package/src/entities/makers.ts +136 -17
- package/src/entities/player.ts +1 -274
- package/src/entities/ship-deploy.ts +258 -0
- package/src/entities/ship.ts +28 -34
- package/src/entities/warehouse.ts +35 -7
- package/src/errors.ts +59 -5
- package/src/format.ts +12 -0
- package/src/index-module.ts +233 -50
- package/src/managers/actions.ts +138 -88
- package/src/managers/context.ts +19 -9
- package/src/managers/index.ts +0 -1
- package/src/managers/locations.ts +2 -85
- package/src/market/items.ts +93 -0
- package/src/nft/description.ts +176 -0
- package/src/nft/deserializers.ts +81 -0
- package/src/nft/index.ts +2 -0
- package/src/resolution/describe-module.ts +165 -0
- package/src/resolution/display-name.ts +39 -0
- package/src/resolution/resolve-item.ts +343 -0
- package/src/scheduling/projection.ts +220 -67
- package/src/scheduling/schedule.ts +2 -2
- package/src/shipload.ts +10 -5
- package/src/subscriptions/connection.ts +154 -0
- package/src/subscriptions/debug.ts +17 -0
- package/src/subscriptions/index.ts +5 -0
- package/src/subscriptions/manager.ts +240 -0
- package/src/subscriptions/mappers.ts +28 -0
- package/src/subscriptions/types.ts +143 -0
- package/src/travel/travel.ts +30 -17
- package/src/types/capabilities.ts +11 -14
- package/src/types/entity-traits.ts +3 -4
- package/src/types/entity.ts +9 -6
- package/src/types.ts +61 -55
- package/src/utils/system.ts +66 -53
- package/src/capabilities/extraction.ts +0 -37
- package/src/data/goods.json +0 -23
- package/src/managers/trades.ts +0 -119
- package/src/market/goods.ts +0 -31
- 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, Int64, UInt16, TimePoint, Bytes, Int32, UInt16Type, UInt8Type, TimePointType, Int64Type, Int32Type, 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';
|
|
@@ -158,29 +158,40 @@ declare namespace platform {
|
|
|
158
158
|
declare const abiBlob: Blob;
|
|
159
159
|
declare const abi: ABI;
|
|
160
160
|
declare namespace Types {
|
|
161
|
+
class addmodule extends Struct {
|
|
162
|
+
entity_type: Name;
|
|
163
|
+
entity_id: UInt64;
|
|
164
|
+
module_index: UInt8;
|
|
165
|
+
module_cargo_id: UInt64;
|
|
166
|
+
target_cargo_id: UInt64;
|
|
167
|
+
}
|
|
168
|
+
class addnexus extends Struct {
|
|
169
|
+
nexus_name: string;
|
|
170
|
+
x: Int64;
|
|
171
|
+
y: Int64;
|
|
172
|
+
}
|
|
161
173
|
class advance extends Struct {
|
|
162
174
|
reveal: string;
|
|
163
175
|
commit: Checksum256;
|
|
164
176
|
}
|
|
165
|
-
class
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
name: string;
|
|
177
|
+
class packed_module extends Struct {
|
|
178
|
+
item_id: UInt16;
|
|
179
|
+
stats: UInt64;
|
|
169
180
|
}
|
|
170
|
-
class
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
good_id: UInt16;
|
|
174
|
-
quantity: UInt32;
|
|
181
|
+
class module_entry extends Struct {
|
|
182
|
+
type: UInt8;
|
|
183
|
+
installed?: packed_module;
|
|
175
184
|
}
|
|
176
|
-
class
|
|
177
|
-
|
|
178
|
-
|
|
185
|
+
class cargo_item extends Struct {
|
|
186
|
+
item_id: UInt16;
|
|
187
|
+
quantity: UInt32;
|
|
188
|
+
stats: UInt64;
|
|
189
|
+
modules: module_entry[];
|
|
179
190
|
}
|
|
180
|
-
class
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
191
|
+
class blend extends Struct {
|
|
192
|
+
entity_type: Name;
|
|
193
|
+
id: UInt64;
|
|
194
|
+
inputs: cargo_item[];
|
|
184
195
|
}
|
|
185
196
|
class cancel extends Struct {
|
|
186
197
|
entity_type: Name;
|
|
@@ -199,25 +210,22 @@ declare namespace Types {
|
|
|
199
210
|
entitygroup?: UInt64;
|
|
200
211
|
group_members?: entity_ref[];
|
|
201
212
|
}
|
|
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
|
-
class cargo_item extends Struct {
|
|
210
|
-
good_id: UInt16;
|
|
211
|
-
quantity: UInt32;
|
|
212
|
-
unit_cost: UInt64;
|
|
213
|
-
mixture?: mixture_info;
|
|
214
|
-
}
|
|
215
213
|
class cargo_row extends Struct {
|
|
216
214
|
id: UInt64;
|
|
217
215
|
entity_id: UInt64;
|
|
218
|
-
|
|
216
|
+
item_id: UInt64;
|
|
219
217
|
quantity: UInt64;
|
|
220
|
-
|
|
218
|
+
stats: UInt64;
|
|
219
|
+
modules: module_entry[];
|
|
220
|
+
}
|
|
221
|
+
class claimstarter extends Struct {
|
|
222
|
+
account: Name;
|
|
223
|
+
x: Int64;
|
|
224
|
+
y: Int64;
|
|
225
|
+
}
|
|
226
|
+
class cleanrsvp extends Struct {
|
|
227
|
+
epoch: UInt64;
|
|
228
|
+
max_rows: UInt64;
|
|
221
229
|
}
|
|
222
230
|
class cleartable extends Struct {
|
|
223
231
|
table_name: Name;
|
|
@@ -227,6 +235,25 @@ declare namespace Types {
|
|
|
227
235
|
class commit extends Struct {
|
|
228
236
|
commit: Checksum256;
|
|
229
237
|
}
|
|
238
|
+
class entity_defaults extends Struct {
|
|
239
|
+
warehouse_z: UInt16;
|
|
240
|
+
container_z: UInt16;
|
|
241
|
+
}
|
|
242
|
+
class item_def extends Struct {
|
|
243
|
+
id: UInt16;
|
|
244
|
+
mass: UInt32;
|
|
245
|
+
type: UInt8;
|
|
246
|
+
subtype: UInt8;
|
|
247
|
+
tier: UInt8;
|
|
248
|
+
}
|
|
249
|
+
class game_config extends Struct {
|
|
250
|
+
version: UInt32;
|
|
251
|
+
defaults: entity_defaults;
|
|
252
|
+
items: item_def[];
|
|
253
|
+
}
|
|
254
|
+
class configlog extends Struct {
|
|
255
|
+
config: game_config;
|
|
256
|
+
}
|
|
230
257
|
class coordinates extends Struct {
|
|
231
258
|
x: Int64;
|
|
232
259
|
y: Int64;
|
|
@@ -240,7 +267,6 @@ declare namespace Types {
|
|
|
240
267
|
cargo: cargo_item[];
|
|
241
268
|
entitytarget?: entity_ref;
|
|
242
269
|
entitygroup?: UInt64;
|
|
243
|
-
credits?: Int64;
|
|
244
270
|
energy_cost?: UInt16;
|
|
245
271
|
}
|
|
246
272
|
class schedule extends Struct {
|
|
@@ -257,6 +283,36 @@ declare namespace Types {
|
|
|
257
283
|
cargomass: UInt32;
|
|
258
284
|
schedule?: schedule;
|
|
259
285
|
}
|
|
286
|
+
class craft extends Struct {
|
|
287
|
+
entity_type: Name;
|
|
288
|
+
id: UInt64;
|
|
289
|
+
recipe_id: UInt16;
|
|
290
|
+
quantity: UInt32;
|
|
291
|
+
inputs: cargo_item[];
|
|
292
|
+
}
|
|
293
|
+
class crafter_stats extends Struct {
|
|
294
|
+
speed: UInt16;
|
|
295
|
+
drain: UInt16;
|
|
296
|
+
}
|
|
297
|
+
class createentity extends Struct {
|
|
298
|
+
owner: Name;
|
|
299
|
+
entity_type: Name;
|
|
300
|
+
entity_name: string;
|
|
301
|
+
x: Int64;
|
|
302
|
+
y: Int64;
|
|
303
|
+
}
|
|
304
|
+
class deploy extends Struct {
|
|
305
|
+
entity_type: Name;
|
|
306
|
+
id: UInt64;
|
|
307
|
+
packed_item_id: UInt16;
|
|
308
|
+
stats: UInt64;
|
|
309
|
+
}
|
|
310
|
+
class descentity extends Struct {
|
|
311
|
+
item_id: UInt16;
|
|
312
|
+
hull_stats: UInt64;
|
|
313
|
+
module_items: UInt16[];
|
|
314
|
+
module_stats: UInt64[];
|
|
315
|
+
}
|
|
260
316
|
class enable extends Struct {
|
|
261
317
|
enabled: boolean;
|
|
262
318
|
}
|
|
@@ -277,10 +333,19 @@ declare namespace Types {
|
|
|
277
333
|
thrust: UInt32;
|
|
278
334
|
drain: UInt16;
|
|
279
335
|
}
|
|
280
|
-
class
|
|
281
|
-
|
|
336
|
+
class gatherer_stats extends Struct {
|
|
337
|
+
yield: UInt16;
|
|
282
338
|
drain: UInt16;
|
|
339
|
+
depth: UInt16;
|
|
340
|
+
speed: UInt16;
|
|
341
|
+
}
|
|
342
|
+
class hauler_stats extends Struct {
|
|
343
|
+
capacity: UInt8;
|
|
283
344
|
efficiency: UInt16;
|
|
345
|
+
drain: UInt16;
|
|
346
|
+
}
|
|
347
|
+
class warp_stats extends Struct {
|
|
348
|
+
range: UInt32;
|
|
284
349
|
}
|
|
285
350
|
class entity_info extends Struct {
|
|
286
351
|
type: Name;
|
|
@@ -291,12 +356,16 @@ declare namespace Types {
|
|
|
291
356
|
cargomass: UInt32;
|
|
292
357
|
cargo: cargo_item[];
|
|
293
358
|
loaders?: loader_stats;
|
|
359
|
+
modules: module_entry[];
|
|
294
360
|
energy?: UInt16;
|
|
295
361
|
hullmass?: UInt32;
|
|
296
362
|
engines?: movement_stats;
|
|
297
363
|
generator?: energy_stats;
|
|
298
364
|
capacity?: UInt32;
|
|
299
|
-
|
|
365
|
+
gatherer?: gatherer_stats;
|
|
366
|
+
hauler?: hauler_stats;
|
|
367
|
+
warp?: warp_stats;
|
|
368
|
+
crafter?: crafter_stats;
|
|
300
369
|
is_idle: boolean;
|
|
301
370
|
current_task?: task;
|
|
302
371
|
current_task_elapsed: UInt32;
|
|
@@ -325,8 +394,13 @@ declare namespace Types {
|
|
|
325
394
|
id: UInt64;
|
|
326
395
|
participants: entity_ref[];
|
|
327
396
|
}
|
|
328
|
-
class
|
|
329
|
-
|
|
397
|
+
class gather extends Struct {
|
|
398
|
+
source: entity_ref;
|
|
399
|
+
destination: entity_ref;
|
|
400
|
+
stratum: UInt16;
|
|
401
|
+
quantity: UInt32;
|
|
402
|
+
}
|
|
403
|
+
class getconfig extends Struct {
|
|
330
404
|
}
|
|
331
405
|
class getentities extends Struct {
|
|
332
406
|
owner: Name;
|
|
@@ -336,7 +410,9 @@ declare namespace Types {
|
|
|
336
410
|
entity_type: Name;
|
|
337
411
|
entity_id: UInt64;
|
|
338
412
|
}
|
|
339
|
-
class
|
|
413
|
+
class getitemdata extends Struct {
|
|
414
|
+
}
|
|
415
|
+
class getitems extends Struct {
|
|
340
416
|
}
|
|
341
417
|
class getlocation extends Struct {
|
|
342
418
|
x: Int64;
|
|
@@ -346,28 +422,36 @@ declare namespace Types {
|
|
|
346
422
|
x: Int64;
|
|
347
423
|
y: Int64;
|
|
348
424
|
}
|
|
425
|
+
class getmodules extends Struct {
|
|
426
|
+
}
|
|
349
427
|
class getnearby extends Struct {
|
|
350
428
|
entity_type: Name;
|
|
351
429
|
entity_id: UInt64;
|
|
352
430
|
recharge: boolean;
|
|
353
431
|
}
|
|
432
|
+
class getnftinfo extends Struct {
|
|
433
|
+
}
|
|
354
434
|
class getplayer extends Struct {
|
|
355
435
|
account: Name;
|
|
356
436
|
}
|
|
357
|
-
class
|
|
437
|
+
class getrecipe extends Struct {
|
|
438
|
+
output_item_id: UInt16;
|
|
439
|
+
}
|
|
440
|
+
class getrecipes extends Struct {
|
|
441
|
+
lower_bound: UInt16;
|
|
442
|
+
limit: UInt8;
|
|
443
|
+
}
|
|
444
|
+
class getresources extends Struct {
|
|
445
|
+
}
|
|
446
|
+
class getstratum extends Struct {
|
|
447
|
+
x: Int64;
|
|
448
|
+
y: Int64;
|
|
449
|
+
stratum: UInt16;
|
|
358
450
|
}
|
|
359
451
|
class getsummaries extends Struct {
|
|
360
452
|
owner: Name;
|
|
361
453
|
entity_type?: Name;
|
|
362
454
|
}
|
|
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
455
|
class grouptravel extends Struct {
|
|
372
456
|
entities: entity_ref[];
|
|
373
457
|
x: Int64;
|
|
@@ -383,6 +467,41 @@ declare namespace Types {
|
|
|
383
467
|
class init extends Struct {
|
|
384
468
|
seed: Checksum256;
|
|
385
469
|
}
|
|
470
|
+
class recipe_input extends Struct {
|
|
471
|
+
item_id: UInt16;
|
|
472
|
+
category: UInt8;
|
|
473
|
+
quantity: UInt32;
|
|
474
|
+
}
|
|
475
|
+
class stat_source extends Struct {
|
|
476
|
+
input_index: UInt8;
|
|
477
|
+
input_stat_index: UInt8;
|
|
478
|
+
}
|
|
479
|
+
class stat_slot_response extends Struct {
|
|
480
|
+
sources: stat_source[];
|
|
481
|
+
}
|
|
482
|
+
class recipe_item_info extends Struct {
|
|
483
|
+
id: UInt16;
|
|
484
|
+
mass: UInt32;
|
|
485
|
+
}
|
|
486
|
+
class recipe_response extends Struct {
|
|
487
|
+
output_item_id: UInt16;
|
|
488
|
+
output_mass: UInt32;
|
|
489
|
+
inputs: recipe_input[];
|
|
490
|
+
stat_slots: stat_slot_response[];
|
|
491
|
+
blend_weights: Bytes;
|
|
492
|
+
output_item: recipe_item_info;
|
|
493
|
+
input_items: recipe_item_info[];
|
|
494
|
+
}
|
|
495
|
+
class recipes_result extends Struct {
|
|
496
|
+
recipes: recipe_response[];
|
|
497
|
+
}
|
|
498
|
+
class itemdata_result extends Struct {
|
|
499
|
+
items: item_def[];
|
|
500
|
+
recipes: recipes_result;
|
|
501
|
+
}
|
|
502
|
+
class items_info extends Struct {
|
|
503
|
+
items: item_def[];
|
|
504
|
+
}
|
|
386
505
|
class join extends Struct {
|
|
387
506
|
account: Name;
|
|
388
507
|
}
|
|
@@ -401,18 +520,11 @@ declare namespace Types {
|
|
|
401
520
|
class location_derived extends Struct {
|
|
402
521
|
static_props: location_static;
|
|
403
522
|
epoch_props: location_epoch;
|
|
404
|
-
|
|
405
|
-
class location_good extends Struct {
|
|
406
|
-
id: UInt16;
|
|
407
|
-
price: UInt32;
|
|
408
|
-
supply: UInt16;
|
|
409
|
-
rarity_multiplier: UInt32;
|
|
410
|
-
location_multiplier: UInt32;
|
|
523
|
+
size: UInt16;
|
|
411
524
|
}
|
|
412
525
|
class location_info extends Struct {
|
|
413
526
|
coords: coordinates;
|
|
414
527
|
is_system: boolean;
|
|
415
|
-
goods: location_good[];
|
|
416
528
|
}
|
|
417
529
|
class location_row extends Struct {
|
|
418
530
|
id: UInt64;
|
|
@@ -422,6 +534,15 @@ declare namespace Types {
|
|
|
422
534
|
cargo: cargo_item[];
|
|
423
535
|
schedule?: schedule;
|
|
424
536
|
}
|
|
537
|
+
class module_info extends Struct {
|
|
538
|
+
id: UInt16;
|
|
539
|
+
mass: UInt32;
|
|
540
|
+
module_type: UInt8;
|
|
541
|
+
tier: UInt8;
|
|
542
|
+
}
|
|
543
|
+
class modules_result extends Struct {
|
|
544
|
+
modules: module_info[];
|
|
545
|
+
}
|
|
425
546
|
class nearby_system extends Struct {
|
|
426
547
|
distance: UInt64;
|
|
427
548
|
energy_cost: UInt64;
|
|
@@ -435,6 +556,33 @@ declare namespace Types {
|
|
|
435
556
|
max_energy: UInt16;
|
|
436
557
|
systems: nearby_system[];
|
|
437
558
|
}
|
|
559
|
+
class nexus_row extends Struct {
|
|
560
|
+
id: UInt64;
|
|
561
|
+
owner: Name;
|
|
562
|
+
name: string;
|
|
563
|
+
coordinates: coordinates;
|
|
564
|
+
}
|
|
565
|
+
class schema_field extends Struct {
|
|
566
|
+
name: string;
|
|
567
|
+
field_type: string;
|
|
568
|
+
}
|
|
569
|
+
class nft_schema_def extends Struct {
|
|
570
|
+
schema_name: Name;
|
|
571
|
+
fields: schema_field[];
|
|
572
|
+
}
|
|
573
|
+
class nft_template_def extends Struct {
|
|
574
|
+
item_id: UInt16;
|
|
575
|
+
schema_name: Name;
|
|
576
|
+
}
|
|
577
|
+
class nftconfig_row extends Struct {
|
|
578
|
+
item_id: UInt16;
|
|
579
|
+
template_id: Int32;
|
|
580
|
+
schema_name: Name;
|
|
581
|
+
}
|
|
582
|
+
class nftinfo_result extends Struct {
|
|
583
|
+
schemas: nft_schema_def[];
|
|
584
|
+
templates: nft_template_def[];
|
|
585
|
+
}
|
|
438
586
|
class task_event extends Struct {
|
|
439
587
|
event_type: UInt8;
|
|
440
588
|
owner: Name;
|
|
@@ -445,47 +593,29 @@ declare namespace Types {
|
|
|
445
593
|
starts_at: TimePoint;
|
|
446
594
|
completes_at: TimePoint;
|
|
447
595
|
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
596
|
}
|
|
454
597
|
class notify extends Struct {
|
|
455
598
|
event: task_event;
|
|
456
599
|
}
|
|
457
|
-
class payloan extends Struct {
|
|
458
|
-
account: Name;
|
|
459
|
-
amount: UInt64;
|
|
460
|
-
}
|
|
461
600
|
class player_info extends Struct {
|
|
462
601
|
owner: Name;
|
|
463
602
|
is_player: boolean;
|
|
464
603
|
company_name: string;
|
|
465
|
-
balance: UInt64;
|
|
466
|
-
debt: UInt32;
|
|
467
|
-
networth: Int64;
|
|
468
|
-
available_loan: UInt64;
|
|
469
|
-
next_ship_price: UInt64;
|
|
470
|
-
next_warehouse_price: UInt64;
|
|
471
|
-
next_container_price: UInt64;
|
|
472
604
|
ship_count: UInt64;
|
|
473
605
|
warehouse_count: UInt64;
|
|
474
606
|
container_count: UInt64;
|
|
475
607
|
}
|
|
476
608
|
class player_row extends Struct {
|
|
477
609
|
owner: Name;
|
|
478
|
-
balance: UInt64;
|
|
479
|
-
debt: UInt32;
|
|
480
|
-
networth: Int64;
|
|
481
|
-
}
|
|
482
|
-
class purgesupply extends Struct {
|
|
483
|
-
max_rows?: UInt64;
|
|
484
610
|
}
|
|
485
611
|
class recharge extends Struct {
|
|
486
612
|
entity_type: Name;
|
|
487
613
|
id: UInt64;
|
|
488
614
|
}
|
|
615
|
+
class reserve_row extends Struct {
|
|
616
|
+
id: UInt64;
|
|
617
|
+
remaining: UInt32;
|
|
618
|
+
}
|
|
489
619
|
class resolve extends Struct {
|
|
490
620
|
entity_type: Name;
|
|
491
621
|
id: UInt64;
|
|
@@ -499,42 +629,77 @@ declare namespace Types {
|
|
|
499
629
|
entitygroup?: UInt64;
|
|
500
630
|
group_members?: entity_ref[];
|
|
501
631
|
}
|
|
502
|
-
class
|
|
503
|
-
|
|
632
|
+
class resource_info extends Struct {
|
|
633
|
+
id: UInt16;
|
|
634
|
+
mass: UInt32;
|
|
635
|
+
category: UInt8;
|
|
636
|
+
tier: UInt8;
|
|
504
637
|
}
|
|
505
|
-
class
|
|
638
|
+
class resource_stats extends Struct {
|
|
639
|
+
stat1: UInt16;
|
|
640
|
+
stat2: UInt16;
|
|
641
|
+
stat3: UInt16;
|
|
642
|
+
}
|
|
643
|
+
class resources_result extends Struct {
|
|
644
|
+
resources: resource_info[];
|
|
645
|
+
}
|
|
646
|
+
class rmmodule extends Struct {
|
|
506
647
|
entity_type: Name;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
648
|
+
entity_id: UInt64;
|
|
649
|
+
module_index: UInt8;
|
|
650
|
+
target_cargo_id: UInt64;
|
|
651
|
+
}
|
|
652
|
+
class rmnftcfg extends Struct {
|
|
653
|
+
item_id: UInt16;
|
|
654
|
+
}
|
|
655
|
+
class salt extends Struct {
|
|
656
|
+
salt: UInt64;
|
|
510
657
|
}
|
|
511
658
|
class sequence_row extends Struct {
|
|
512
659
|
key: Name;
|
|
513
660
|
value: UInt64;
|
|
514
661
|
}
|
|
515
|
-
class
|
|
516
|
-
|
|
662
|
+
class setnftcfg extends Struct {
|
|
663
|
+
item_id: UInt16;
|
|
664
|
+
template_id: Int32;
|
|
665
|
+
schema_name: Name;
|
|
517
666
|
}
|
|
518
667
|
class ship_row extends Struct {
|
|
519
668
|
id: UInt64;
|
|
520
669
|
owner: Name;
|
|
521
670
|
name: string;
|
|
671
|
+
stats: UInt64;
|
|
522
672
|
coordinates: coordinates;
|
|
523
|
-
hullmass
|
|
524
|
-
capacity
|
|
525
|
-
energy
|
|
673
|
+
hullmass?: UInt32;
|
|
674
|
+
capacity?: UInt32;
|
|
675
|
+
energy?: UInt16;
|
|
526
676
|
cargomass: UInt32;
|
|
527
|
-
engines
|
|
528
|
-
generator
|
|
529
|
-
loaders
|
|
530
|
-
|
|
531
|
-
|
|
677
|
+
engines?: movement_stats;
|
|
678
|
+
generator?: energy_stats;
|
|
679
|
+
loaders?: loader_stats;
|
|
680
|
+
gatherer?: gatherer_stats;
|
|
681
|
+
warp?: warp_stats;
|
|
682
|
+
crafter?: crafter_stats;
|
|
683
|
+
hauler?: hauler_stats;
|
|
684
|
+
modules: module_entry[];
|
|
532
685
|
schedule?: schedule;
|
|
533
686
|
}
|
|
534
|
-
class
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
687
|
+
class spawncargo extends Struct {
|
|
688
|
+
entity_id: UInt64;
|
|
689
|
+
item_id: UInt64;
|
|
690
|
+
quantity: UInt64;
|
|
691
|
+
}
|
|
692
|
+
class spawnpacked extends Struct {
|
|
693
|
+
entity_id: UInt64;
|
|
694
|
+
item_id: UInt16;
|
|
695
|
+
hull_stats: UInt64;
|
|
696
|
+
installed: packed_module[];
|
|
697
|
+
}
|
|
698
|
+
class spawnseeded extends Struct {
|
|
699
|
+
entity_id: UInt64;
|
|
700
|
+
item_id: UInt64;
|
|
701
|
+
quantity: UInt64;
|
|
702
|
+
stats: UInt64;
|
|
538
703
|
}
|
|
539
704
|
class state_row extends Struct {
|
|
540
705
|
enabled: boolean;
|
|
@@ -544,16 +709,16 @@ declare namespace Types {
|
|
|
544
709
|
seed: Checksum256;
|
|
545
710
|
commit: Checksum256;
|
|
546
711
|
}
|
|
547
|
-
class
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
712
|
+
class stratum_info extends Struct {
|
|
713
|
+
item_id: UInt16;
|
|
714
|
+
seed: UInt64;
|
|
715
|
+
richness: UInt16;
|
|
716
|
+
reserve: UInt32;
|
|
717
|
+
reserve_max: UInt32;
|
|
553
718
|
}
|
|
554
|
-
class
|
|
555
|
-
|
|
556
|
-
|
|
719
|
+
class stratum_data extends Struct {
|
|
720
|
+
stratum: stratum_info;
|
|
721
|
+
stats: resource_stats;
|
|
557
722
|
}
|
|
558
723
|
class task_results extends Struct {
|
|
559
724
|
entities: entity_task_info[];
|
|
@@ -563,7 +728,8 @@ declare namespace Types {
|
|
|
563
728
|
source_id: UInt64;
|
|
564
729
|
dest_type: Name;
|
|
565
730
|
dest_id: UInt64;
|
|
566
|
-
|
|
731
|
+
item_id: UInt16;
|
|
732
|
+
stats: UInt64;
|
|
567
733
|
quantity: UInt32;
|
|
568
734
|
}
|
|
569
735
|
class travel extends Struct {
|
|
@@ -576,41 +742,51 @@ declare namespace Types {
|
|
|
576
742
|
class types_row extends Struct {
|
|
577
743
|
id: UInt64;
|
|
578
744
|
entity_summary_type: entity_summary;
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
class updatecredit extends Struct {
|
|
582
|
-
account: Name;
|
|
583
|
-
amount: Int64;
|
|
584
|
-
}
|
|
585
|
-
class updatedebt extends Struct {
|
|
586
|
-
account: Name;
|
|
587
|
-
amount: Int64;
|
|
745
|
+
game_config_type: game_config;
|
|
588
746
|
}
|
|
589
747
|
class warehouse_row extends Struct {
|
|
590
748
|
id: UInt64;
|
|
591
749
|
owner: Name;
|
|
592
750
|
name: string;
|
|
751
|
+
stats: UInt64;
|
|
593
752
|
coordinates: coordinates;
|
|
594
|
-
|
|
753
|
+
hullmass?: UInt32;
|
|
754
|
+
capacity?: UInt32;
|
|
595
755
|
cargomass: UInt32;
|
|
596
|
-
loaders
|
|
756
|
+
loaders?: loader_stats;
|
|
757
|
+
modules: module_entry[];
|
|
597
758
|
schedule?: schedule;
|
|
598
759
|
}
|
|
760
|
+
class warp extends Struct {
|
|
761
|
+
entity_type: Name;
|
|
762
|
+
id: UInt64;
|
|
763
|
+
x: Int64;
|
|
764
|
+
y: Int64;
|
|
765
|
+
}
|
|
599
766
|
class wipe extends Struct {
|
|
600
767
|
}
|
|
601
768
|
class wipesequence extends Struct {
|
|
602
769
|
}
|
|
770
|
+
class wrap extends Struct {
|
|
771
|
+
owner: Name;
|
|
772
|
+
entity_type: Name;
|
|
773
|
+
entity_id: UInt64;
|
|
774
|
+
cargo_id: UInt64;
|
|
775
|
+
quantity: UInt64;
|
|
776
|
+
}
|
|
603
777
|
}
|
|
604
778
|
declare const TableMap: {
|
|
605
779
|
cargo: typeof Types.cargo_row;
|
|
606
780
|
container: typeof Types.container_row;
|
|
607
781
|
entitygroup: typeof Types.entitygroup_row;
|
|
608
782
|
location: typeof Types.location_row;
|
|
783
|
+
nexus: typeof Types.nexus_row;
|
|
784
|
+
nftconfig: typeof Types.nftconfig_row;
|
|
609
785
|
player: typeof Types.player_row;
|
|
786
|
+
reserve: typeof Types.reserve_row;
|
|
610
787
|
sequence: typeof Types.sequence_row;
|
|
611
788
|
ship: typeof Types.ship_row;
|
|
612
789
|
state: typeof Types.state_row;
|
|
613
|
-
supply: typeof Types.supply_row;
|
|
614
790
|
types: typeof Types.types_row;
|
|
615
791
|
warehouse: typeof Types.warehouse_row;
|
|
616
792
|
};
|
|
@@ -619,11 +795,13 @@ interface TableTypes {
|
|
|
619
795
|
container: Types.container_row;
|
|
620
796
|
entitygroup: Types.entitygroup_row;
|
|
621
797
|
location: Types.location_row;
|
|
798
|
+
nexus: Types.nexus_row;
|
|
799
|
+
nftconfig: Types.nftconfig_row;
|
|
622
800
|
player: Types.player_row;
|
|
801
|
+
reserve: Types.reserve_row;
|
|
623
802
|
sequence: Types.sequence_row;
|
|
624
803
|
ship: Types.ship_row;
|
|
625
804
|
state: Types.state_row;
|
|
626
|
-
supply: Types.supply_row;
|
|
627
805
|
types: Types.types_row;
|
|
628
806
|
warehouse: Types.warehouse_row;
|
|
629
807
|
}
|
|
@@ -631,6 +809,36 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
|
|
|
631
809
|
type TableNames = keyof TableTypes;
|
|
632
810
|
declare namespace ActionParams {
|
|
633
811
|
namespace Type {
|
|
812
|
+
interface cargo_item {
|
|
813
|
+
item_id: UInt16Type;
|
|
814
|
+
quantity: UInt32Type;
|
|
815
|
+
stats: UInt64Type;
|
|
816
|
+
modules: Type.module_entry[];
|
|
817
|
+
}
|
|
818
|
+
interface module_entry {
|
|
819
|
+
type: UInt8Type;
|
|
820
|
+
installed?: Type.packed_module;
|
|
821
|
+
}
|
|
822
|
+
interface packed_module {
|
|
823
|
+
item_id: UInt16Type;
|
|
824
|
+
stats: UInt64Type;
|
|
825
|
+
}
|
|
826
|
+
interface game_config {
|
|
827
|
+
version: UInt32Type;
|
|
828
|
+
defaults: Type.entity_defaults;
|
|
829
|
+
items: Type.item_def[];
|
|
830
|
+
}
|
|
831
|
+
interface entity_defaults {
|
|
832
|
+
warehouse_z: UInt16Type;
|
|
833
|
+
container_z: UInt16Type;
|
|
834
|
+
}
|
|
835
|
+
interface item_def {
|
|
836
|
+
id: UInt16Type;
|
|
837
|
+
mass: UInt32Type;
|
|
838
|
+
type: UInt8Type;
|
|
839
|
+
subtype: UInt8Type;
|
|
840
|
+
tier: UInt8Type;
|
|
841
|
+
}
|
|
634
842
|
interface entity_ref {
|
|
635
843
|
entity_type: NameType;
|
|
636
844
|
entity_id: UInt64Type;
|
|
@@ -645,11 +853,6 @@ declare namespace ActionParams {
|
|
|
645
853
|
starts_at: TimePointType;
|
|
646
854
|
completes_at: TimePointType;
|
|
647
855
|
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
856
|
}
|
|
654
857
|
interface task {
|
|
655
858
|
type: UInt8Type;
|
|
@@ -659,7 +862,6 @@ declare namespace ActionParams {
|
|
|
659
862
|
cargo: Type.cargo_item[];
|
|
660
863
|
entitytarget?: Type.entity_ref;
|
|
661
864
|
entitygroup?: UInt64Type;
|
|
662
|
-
credits?: Int64Type;
|
|
663
865
|
energy_cost?: UInt16Type;
|
|
664
866
|
}
|
|
665
867
|
interface coordinates {
|
|
@@ -667,49 +869,42 @@ declare namespace ActionParams {
|
|
|
667
869
|
y: Int64Type;
|
|
668
870
|
z?: UInt16Type;
|
|
669
871
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
872
|
+
}
|
|
873
|
+
interface addmodule {
|
|
874
|
+
entity_type: NameType;
|
|
875
|
+
entity_id: UInt64Type;
|
|
876
|
+
module_index: UInt8Type;
|
|
877
|
+
module_cargo_id: UInt64Type;
|
|
878
|
+
target_cargo_id: UInt64Type;
|
|
879
|
+
}
|
|
880
|
+
interface addnexus {
|
|
881
|
+
nexus_name: string;
|
|
882
|
+
x: Int64Type;
|
|
883
|
+
y: Int64Type;
|
|
683
884
|
}
|
|
684
885
|
interface advance {
|
|
685
886
|
reveal: string;
|
|
686
887
|
commit: Checksum256Type;
|
|
687
888
|
}
|
|
688
|
-
interface
|
|
689
|
-
account: NameType;
|
|
690
|
-
ship_id: UInt64Type;
|
|
691
|
-
name: string;
|
|
692
|
-
}
|
|
693
|
-
interface buygoods {
|
|
889
|
+
interface blend {
|
|
694
890
|
entity_type: NameType;
|
|
695
891
|
id: UInt64Type;
|
|
696
|
-
|
|
697
|
-
quantity: UInt32Type;
|
|
698
|
-
}
|
|
699
|
-
interface buyship {
|
|
700
|
-
account: NameType;
|
|
701
|
-
name: string;
|
|
702
|
-
}
|
|
703
|
-
interface buywarehouse {
|
|
704
|
-
account: NameType;
|
|
705
|
-
ship_id: UInt64Type;
|
|
706
|
-
name: string;
|
|
892
|
+
inputs: Type.cargo_item[];
|
|
707
893
|
}
|
|
708
894
|
interface cancel {
|
|
709
895
|
entity_type: NameType;
|
|
710
896
|
id: UInt64Type;
|
|
711
897
|
count: UInt64Type;
|
|
712
898
|
}
|
|
899
|
+
interface claimstarter {
|
|
900
|
+
account: NameType;
|
|
901
|
+
x: Int64Type;
|
|
902
|
+
y: Int64Type;
|
|
903
|
+
}
|
|
904
|
+
interface cleanrsvp {
|
|
905
|
+
epoch: UInt64Type;
|
|
906
|
+
max_rows: UInt64Type;
|
|
907
|
+
}
|
|
713
908
|
interface cleartable {
|
|
714
909
|
table_name: NameType;
|
|
715
910
|
scope?: NameType;
|
|
@@ -718,11 +913,45 @@ declare namespace ActionParams {
|
|
|
718
913
|
interface commit {
|
|
719
914
|
commit: Checksum256Type;
|
|
720
915
|
}
|
|
916
|
+
interface configlog {
|
|
917
|
+
config: Type.game_config;
|
|
918
|
+
}
|
|
919
|
+
interface craft {
|
|
920
|
+
entity_type: NameType;
|
|
921
|
+
id: UInt64Type;
|
|
922
|
+
recipe_id: UInt16Type;
|
|
923
|
+
quantity: UInt32Type;
|
|
924
|
+
inputs: Type.cargo_item[];
|
|
925
|
+
}
|
|
926
|
+
interface createentity {
|
|
927
|
+
owner: NameType;
|
|
928
|
+
entity_type: NameType;
|
|
929
|
+
entity_name: string;
|
|
930
|
+
x: Int64Type;
|
|
931
|
+
y: Int64Type;
|
|
932
|
+
}
|
|
933
|
+
interface deploy {
|
|
934
|
+
entity_type: NameType;
|
|
935
|
+
id: UInt64Type;
|
|
936
|
+
packed_item_id: UInt16Type;
|
|
937
|
+
stats: UInt64Type;
|
|
938
|
+
}
|
|
939
|
+
interface descentity {
|
|
940
|
+
item_id: UInt16Type;
|
|
941
|
+
hull_stats: UInt64Type;
|
|
942
|
+
module_items: UInt16Type[];
|
|
943
|
+
module_stats: UInt64Type[];
|
|
944
|
+
}
|
|
721
945
|
interface enable {
|
|
722
946
|
enabled: boolean;
|
|
723
947
|
}
|
|
724
|
-
interface
|
|
725
|
-
|
|
948
|
+
interface gather {
|
|
949
|
+
source: Type.entity_ref;
|
|
950
|
+
destination: Type.entity_ref;
|
|
951
|
+
stratum: UInt16Type;
|
|
952
|
+
quantity: UInt32Type;
|
|
953
|
+
}
|
|
954
|
+
interface getconfig {
|
|
726
955
|
}
|
|
727
956
|
interface getentities {
|
|
728
957
|
owner: NameType;
|
|
@@ -732,7 +961,9 @@ declare namespace ActionParams {
|
|
|
732
961
|
entity_type: NameType;
|
|
733
962
|
entity_id: UInt64Type;
|
|
734
963
|
}
|
|
735
|
-
interface
|
|
964
|
+
interface getitemdata {
|
|
965
|
+
}
|
|
966
|
+
interface getitems {
|
|
736
967
|
}
|
|
737
968
|
interface getlocation {
|
|
738
969
|
x: Int64Type;
|
|
@@ -742,15 +973,31 @@ declare namespace ActionParams {
|
|
|
742
973
|
x: Int64Type;
|
|
743
974
|
y: Int64Type;
|
|
744
975
|
}
|
|
976
|
+
interface getmodules {
|
|
977
|
+
}
|
|
745
978
|
interface getnearby {
|
|
746
979
|
entity_type: NameType;
|
|
747
980
|
entity_id: UInt64Type;
|
|
748
981
|
recharge: boolean;
|
|
749
982
|
}
|
|
983
|
+
interface getnftinfo {
|
|
984
|
+
}
|
|
750
985
|
interface getplayer {
|
|
751
986
|
account: NameType;
|
|
752
987
|
}
|
|
753
|
-
interface
|
|
988
|
+
interface getrecipe {
|
|
989
|
+
output_item_id: UInt16Type;
|
|
990
|
+
}
|
|
991
|
+
interface getrecipes {
|
|
992
|
+
lower_bound: UInt16Type;
|
|
993
|
+
limit: UInt8Type;
|
|
994
|
+
}
|
|
995
|
+
interface getresources {
|
|
996
|
+
}
|
|
997
|
+
interface getstratum {
|
|
998
|
+
x: Int64Type;
|
|
999
|
+
y: Int64Type;
|
|
1000
|
+
stratum: UInt16Type;
|
|
754
1001
|
}
|
|
755
1002
|
interface getsummaries {
|
|
756
1003
|
owner: NameType;
|
|
@@ -777,13 +1024,6 @@ declare namespace ActionParams {
|
|
|
777
1024
|
interface notify {
|
|
778
1025
|
event: Type.task_event;
|
|
779
1026
|
}
|
|
780
|
-
interface payloan {
|
|
781
|
-
account: NameType;
|
|
782
|
-
amount: UInt64Type;
|
|
783
|
-
}
|
|
784
|
-
interface purgesupply {
|
|
785
|
-
max_rows?: UInt64Type;
|
|
786
|
-
}
|
|
787
1027
|
interface recharge {
|
|
788
1028
|
entity_type: NameType;
|
|
789
1029
|
id: UInt64Type;
|
|
@@ -793,25 +1033,47 @@ declare namespace ActionParams {
|
|
|
793
1033
|
id: UInt64Type;
|
|
794
1034
|
count?: UInt64Type;
|
|
795
1035
|
}
|
|
1036
|
+
interface rmmodule {
|
|
1037
|
+
entity_type: NameType;
|
|
1038
|
+
entity_id: UInt64Type;
|
|
1039
|
+
module_index: UInt8Type;
|
|
1040
|
+
target_cargo_id: UInt64Type;
|
|
1041
|
+
}
|
|
1042
|
+
interface rmnftcfg {
|
|
1043
|
+
item_id: UInt16Type;
|
|
1044
|
+
}
|
|
796
1045
|
interface salt {
|
|
797
1046
|
salt: UInt64Type;
|
|
798
1047
|
}
|
|
799
|
-
interface
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
quantity: UInt32Type;
|
|
1048
|
+
interface setnftcfg {
|
|
1049
|
+
item_id: UInt16Type;
|
|
1050
|
+
template_id: Int32Type;
|
|
1051
|
+
schema_name: NameType;
|
|
804
1052
|
}
|
|
805
|
-
interface
|
|
806
|
-
|
|
807
|
-
|
|
1053
|
+
interface spawncargo {
|
|
1054
|
+
entity_id: UInt64Type;
|
|
1055
|
+
item_id: UInt64Type;
|
|
1056
|
+
quantity: UInt64Type;
|
|
1057
|
+
}
|
|
1058
|
+
interface spawnpacked {
|
|
1059
|
+
entity_id: UInt64Type;
|
|
1060
|
+
item_id: UInt16Type;
|
|
1061
|
+
hull_stats: UInt64Type;
|
|
1062
|
+
installed: Type.packed_module[];
|
|
1063
|
+
}
|
|
1064
|
+
interface spawnseeded {
|
|
1065
|
+
entity_id: UInt64Type;
|
|
1066
|
+
item_id: UInt64Type;
|
|
1067
|
+
quantity: UInt64Type;
|
|
1068
|
+
stats: UInt64Type;
|
|
808
1069
|
}
|
|
809
1070
|
interface transfer {
|
|
810
1071
|
source_type: NameType;
|
|
811
1072
|
source_id: UInt64Type;
|
|
812
1073
|
dest_type: NameType;
|
|
813
1074
|
dest_id: UInt64Type;
|
|
814
|
-
|
|
1075
|
+
item_id: UInt16Type;
|
|
1076
|
+
stats: UInt64Type;
|
|
815
1077
|
quantity: UInt32Type;
|
|
816
1078
|
}
|
|
817
1079
|
interface travel {
|
|
@@ -821,38 +1083,56 @@ declare namespace ActionParams {
|
|
|
821
1083
|
y: Int64Type;
|
|
822
1084
|
recharge: boolean;
|
|
823
1085
|
}
|
|
824
|
-
interface
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
account: NameType;
|
|
830
|
-
amount: Int64Type;
|
|
1086
|
+
interface warp {
|
|
1087
|
+
entity_type: NameType;
|
|
1088
|
+
id: UInt64Type;
|
|
1089
|
+
x: Int64Type;
|
|
1090
|
+
y: Int64Type;
|
|
831
1091
|
}
|
|
832
1092
|
interface wipe {
|
|
833
1093
|
}
|
|
834
1094
|
interface wipesequence {
|
|
835
1095
|
}
|
|
1096
|
+
interface wrap {
|
|
1097
|
+
owner: NameType;
|
|
1098
|
+
entity_type: NameType;
|
|
1099
|
+
entity_id: UInt64Type;
|
|
1100
|
+
cargo_id: UInt64Type;
|
|
1101
|
+
quantity: UInt64Type;
|
|
1102
|
+
}
|
|
836
1103
|
}
|
|
837
1104
|
interface ActionNameParams {
|
|
1105
|
+
addmodule: ActionParams.addmodule;
|
|
1106
|
+
addnexus: ActionParams.addnexus;
|
|
838
1107
|
advance: ActionParams.advance;
|
|
839
|
-
|
|
840
|
-
buygoods: ActionParams.buygoods;
|
|
841
|
-
buyship: ActionParams.buyship;
|
|
842
|
-
buywarehouse: ActionParams.buywarehouse;
|
|
1108
|
+
blend: ActionParams.blend;
|
|
843
1109
|
cancel: ActionParams.cancel;
|
|
1110
|
+
claimstarter: ActionParams.claimstarter;
|
|
1111
|
+
cleanrsvp: ActionParams.cleanrsvp;
|
|
844
1112
|
cleartable: ActionParams.cleartable;
|
|
845
1113
|
commit: ActionParams.commit;
|
|
1114
|
+
configlog: ActionParams.configlog;
|
|
1115
|
+
craft: ActionParams.craft;
|
|
1116
|
+
createentity: ActionParams.createentity;
|
|
1117
|
+
deploy: ActionParams.deploy;
|
|
1118
|
+
descentity: ActionParams.descentity;
|
|
846
1119
|
enable: ActionParams.enable;
|
|
847
|
-
|
|
1120
|
+
gather: ActionParams.gather;
|
|
1121
|
+
getconfig: ActionParams.getconfig;
|
|
848
1122
|
getentities: ActionParams.getentities;
|
|
849
1123
|
getentity: ActionParams.getentity;
|
|
850
|
-
|
|
1124
|
+
getitemdata: ActionParams.getitemdata;
|
|
1125
|
+
getitems: ActionParams.getitems;
|
|
851
1126
|
getlocation: ActionParams.getlocation;
|
|
852
1127
|
getlocdata: ActionParams.getlocdata;
|
|
1128
|
+
getmodules: ActionParams.getmodules;
|
|
853
1129
|
getnearby: ActionParams.getnearby;
|
|
1130
|
+
getnftinfo: ActionParams.getnftinfo;
|
|
854
1131
|
getplayer: ActionParams.getplayer;
|
|
855
|
-
|
|
1132
|
+
getrecipe: ActionParams.getrecipe;
|
|
1133
|
+
getrecipes: ActionParams.getrecipes;
|
|
1134
|
+
getresources: ActionParams.getresources;
|
|
1135
|
+
getstratum: ActionParams.getstratum;
|
|
856
1136
|
getsummaries: ActionParams.getsummaries;
|
|
857
1137
|
grouptravel: ActionParams.grouptravel;
|
|
858
1138
|
hash: ActionParams.hash;
|
|
@@ -860,42 +1140,54 @@ interface ActionNameParams {
|
|
|
860
1140
|
init: ActionParams.init;
|
|
861
1141
|
join: ActionParams.join;
|
|
862
1142
|
notify: ActionParams.notify;
|
|
863
|
-
payloan: ActionParams.payloan;
|
|
864
|
-
purgesupply: ActionParams.purgesupply;
|
|
865
1143
|
recharge: ActionParams.recharge;
|
|
866
1144
|
resolve: ActionParams.resolve;
|
|
1145
|
+
rmmodule: ActionParams.rmmodule;
|
|
1146
|
+
rmnftcfg: ActionParams.rmnftcfg;
|
|
867
1147
|
salt: ActionParams.salt;
|
|
868
|
-
|
|
869
|
-
|
|
1148
|
+
setnftcfg: ActionParams.setnftcfg;
|
|
1149
|
+
spawncargo: ActionParams.spawncargo;
|
|
1150
|
+
spawnpacked: ActionParams.spawnpacked;
|
|
1151
|
+
spawnseeded: ActionParams.spawnseeded;
|
|
870
1152
|
transfer: ActionParams.transfer;
|
|
871
1153
|
travel: ActionParams.travel;
|
|
872
|
-
|
|
873
|
-
updatedebt: ActionParams.updatedebt;
|
|
1154
|
+
warp: ActionParams.warp;
|
|
874
1155
|
wipe: ActionParams.wipe;
|
|
875
1156
|
wipesequence: ActionParams.wipesequence;
|
|
1157
|
+
wrap: ActionParams.wrap;
|
|
876
1158
|
}
|
|
877
1159
|
type ActionNames = keyof ActionNameParams;
|
|
878
1160
|
interface ActionReturnValues {
|
|
879
|
-
buygoods: Types.task_results;
|
|
880
1161
|
cancel: Types.cancel_results;
|
|
881
|
-
|
|
1162
|
+
craft: Types.task_results;
|
|
1163
|
+
deploy: Types.task_results;
|
|
1164
|
+
descentity: string;
|
|
1165
|
+
gather: Types.task_results;
|
|
1166
|
+
getconfig: Types.game_config;
|
|
882
1167
|
getentities: Types.entity_info[];
|
|
883
1168
|
getentity: Types.entity_info;
|
|
884
|
-
|
|
1169
|
+
getitemdata: Types.itemdata_result;
|
|
1170
|
+
getitems: Types.items_info;
|
|
885
1171
|
getlocation: Types.location_info;
|
|
886
1172
|
getlocdata: Types.location_derived;
|
|
1173
|
+
getmodules: Types.modules_result;
|
|
887
1174
|
getnearby: Types.nearby_info;
|
|
1175
|
+
getnftinfo: Types.nftinfo_result;
|
|
888
1176
|
getplayer: Types.player_info;
|
|
889
|
-
|
|
1177
|
+
getrecipe: Types.recipes_result;
|
|
1178
|
+
getrecipes: Types.recipes_result;
|
|
1179
|
+
getresources: Types.resources_result;
|
|
1180
|
+
getstratum: Types.stratum_data;
|
|
890
1181
|
getsummaries: Types.entity_summary[];
|
|
891
1182
|
grouptravel: Types.task_results;
|
|
892
1183
|
hash: Checksum256;
|
|
893
1184
|
hash512: Checksum512;
|
|
894
1185
|
recharge: Types.task_results;
|
|
895
1186
|
resolve: Types.resolve_results;
|
|
896
|
-
sellgoods: Types.task_results;
|
|
897
1187
|
transfer: Types.task_results;
|
|
898
1188
|
travel: Types.task_results;
|
|
1189
|
+
warp: Types.task_results;
|
|
1190
|
+
wrap: Types.task_results;
|
|
899
1191
|
}
|
|
900
1192
|
type ActionReturnNames = keyof ActionReturnValues;
|
|
901
1193
|
declare class Contract extends Contract$2 {
|
|
@@ -948,16 +1240,14 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
|
|
|
948
1240
|
declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
|
|
949
1241
|
declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
|
|
950
1242
|
declare const GAME_SEED_NOT_SET = "This game has not initialized an epoch seed value.";
|
|
951
|
-
declare const
|
|
952
|
-
declare const GOOD_NOT_AVAILABLE_AT_LOCATION = "Good is not tradeable at ship location.";
|
|
953
|
-
declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
|
|
954
|
-
declare const INSUFFICIENT_GOOD_QUANTITY = "Insufficient quantity in cargo.";
|
|
955
|
-
declare const INSUFFICIENT_GOOD_SUPPLY = "Insufficient supply of good at location.";
|
|
1243
|
+
declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
|
|
956
1244
|
declare const INVALID_AMOUNT = "Invalid amount.";
|
|
957
1245
|
declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
|
|
958
1246
|
declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
|
|
959
1247
|
declare const PLAYER_ALREADY_JOINED = "Player has already joined the game.";
|
|
1248
|
+
declare const PLAYER_NOT_JOINED = "Player has not joined the game.";
|
|
960
1249
|
declare const PLAYER_NOT_FOUND = "Cannot find player for given account name.";
|
|
1250
|
+
declare const STARTER_ALREADY_CLAIMED = "Starter ship already claimed; destroy existing ships to re-claim.";
|
|
961
1251
|
declare const SHIP_ALREADY_THERE = "Ship cannot travel to the location its already at.";
|
|
962
1252
|
declare const SHIP_ALREADY_TRAVELING = "Ship is already traveling.";
|
|
963
1253
|
declare const SHIP_CANNOT_BUY_TRAVELING = "Ship cannot buy goods while traveling.";
|
|
@@ -972,50 +1262,83 @@ declare const SHIP_NOT_OWNED = "Ship is not owned by this account.";
|
|
|
972
1262
|
declare const NO_SCHEDULE = "No scheduled tasks.";
|
|
973
1263
|
declare const SHIP_NOT_IDLE = "Ship must be idle (no active schedule) for this action.";
|
|
974
1264
|
declare const SHIP_NO_COMPLETED_TASKS = "No completed tasks to resolve.";
|
|
1265
|
+
declare const RESOLVE_COUNT_EXCEEDS_COMPLETED = "Requested resolve count exceeds completed tasks.";
|
|
975
1266
|
declare const SHIP_CANNOT_CANCEL_TASK = "Cannot cancel task that is immutable or in progress.";
|
|
976
1267
|
declare const SHIP_NO_TASKS_TO_CANCEL = "No tasks to cancel.";
|
|
977
1268
|
declare const SHIP_INVALID_CARGO = "Invalid cargo specified for load/unload.";
|
|
978
1269
|
declare const SHIP_CARGO_NOT_OWNED = "Cannot load cargo that is not owned.";
|
|
979
1270
|
declare const SHIP_CARGO_NOT_LOADED = "Cannot unload cargo that is not loaded.";
|
|
1271
|
+
declare const SHIP_CAPACITY_EXCEEDED = "Ship cargo capacity would be exceeded.";
|
|
1272
|
+
declare const ENTITY_CAPACITY_EXCEEDED = "Entity cargo capacity would be exceeded.";
|
|
980
1273
|
declare const WAREHOUSE_NOT_FOUND = "Cannot find warehouse for given id.";
|
|
981
1274
|
declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this location.";
|
|
982
1275
|
declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
|
|
1276
|
+
declare const CONTAINER_NOT_FOUND = "Cannot find container for given id.";
|
|
1277
|
+
declare const CONTAINER_CAPACITY_EXCEEDED = "Container capacity would be exceeded.";
|
|
1278
|
+
declare const DESTINATION_CAPACITY_EXCEEDED = "Destination entity does not have enough capacity for the gather.";
|
|
1279
|
+
declare const CANCEL_PAIRED_HAS_PENDING = "Cannot cancel transfer, paired entity has pending tasks.";
|
|
1280
|
+
declare const GROUP_EMPTY = "Group travel requires at least one entity.";
|
|
1281
|
+
declare const GROUP_NO_THRUST = "Group travel requires at least one entity with engines.";
|
|
1282
|
+
declare const GROUP_NOT_SAME_LOCATION = "All entities must be at the same location for group travel.";
|
|
1283
|
+
declare const GROUP_NOT_SAME_OWNER = "All entities must have the same owner for group travel.";
|
|
1284
|
+
declare const GROUP_ENTITY_NOT_MOVABLE = "Entity cannot participate in group travel.";
|
|
1285
|
+
declare const GROUP_NOT_FOUND = "Entity group not found.";
|
|
1286
|
+
declare const GROUP_DUPLICATE_ENTITY = "Duplicate entity in group.";
|
|
1287
|
+
declare const GROUP_HAUL_CAPACITY_EXCEEDED = "Group travel requires sufficient hauler capacity for all non-self-propelled entities.";
|
|
1288
|
+
declare const CANCEL_CONTAINS_GROUPED_TASK = "Cannot cancel range containing grouped task - cancel non-grouped tasks first.";
|
|
1289
|
+
declare const WARP_NO_CAPABILITY = "Entity does not have warp capability.";
|
|
1290
|
+
declare const WARP_HAS_SCHEDULE = "Entity must be idle to warp.";
|
|
1291
|
+
declare const WARP_HAS_CARGO = "Entity must have no cargo to warp.";
|
|
1292
|
+
declare const WARP_NOT_FULL_ENERGY = "Entity must have full energy to warp.";
|
|
1293
|
+
declare const WARP_OUT_OF_RANGE = "Destination exceeds warp range.";
|
|
1294
|
+
declare const ENTITY_NO_CRAFTER = "Entity does not have crafting capability.";
|
|
1295
|
+
declare const RECIPE_NOT_FOUND = "Recipe does not exist.";
|
|
1296
|
+
declare const RECIPE_INPUTS_INSUFFICIENT = "Insufficient inputs for recipe.";
|
|
1297
|
+
declare const RECIPE_INPUTS_INVALID = "Input cargo does not match recipe requirements.";
|
|
1298
|
+
declare const RECIPE_INPUTS_EXCESS = "Provided inputs exceed recipe requirements.";
|
|
1299
|
+
declare const RECIPE_INPUTS_MIXED = "All stacks for a recipe input must be the same resource.";
|
|
1300
|
+
declare const ITEM_NOT_DEPLOYABLE = "Item cannot be deployed as an entity.";
|
|
1301
|
+
declare const DEPLOY_ENTITY_HAS_SCHEDULE = "Entity must be idle to deploy.";
|
|
1302
|
+
declare const BLEND_INPUTS_MUST_MATCH = "All blend inputs must be the same item.";
|
|
1303
|
+
declare const GATHER_NOT_ENOUGH_ENERGY = "Gather requires more energy than entity has.";
|
|
1304
|
+
declare const GATHER_EXCEEDS_ENERGY_CAPACITY = "Gather drain exceeds entity's energy capacity.";
|
|
1305
|
+
declare const CRAFT_NOT_ENOUGH_ENERGY = "Craft requires more energy than entity has.";
|
|
1306
|
+
declare const CRAFT_EXCEEDS_ENERGY_CAPACITY = "Craft drain exceeds entity's energy capacity.";
|
|
1307
|
+
declare const BLEND_REQUIRES_MULTIPLE = "Blend requires at least two input stacks.";
|
|
1308
|
+
declare const BLEND_STAT_LESS_NOT_SUPPORTED = "Stat-less items cannot be blended.";
|
|
1309
|
+
declare const MODULE_SLOT_INVALID = "Module slot index is invalid.";
|
|
1310
|
+
declare const MODULE_SLOT_OCCUPIED = "Module slot is already occupied.";
|
|
1311
|
+
declare const MODULE_SLOT_EMPTY = "Module slot is empty.";
|
|
1312
|
+
declare const MODULE_TYPE_MISMATCH = "Module type not allowed in this slot.";
|
|
1313
|
+
declare const MODULE_CARGO_NOT_FOUND = "Module cargo not found.";
|
|
1314
|
+
declare const MODULE_NOT_MODULE = "Item is not a module.";
|
|
1315
|
+
declare const MODULE_ENTITY_BUSY = "Entity must be idle to modify modules.";
|
|
1316
|
+
declare const ITEM_NOT_PACKED_ENTITY = "Item is not a packed entity.";
|
|
1317
|
+
declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
|
|
1318
|
+
declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
|
|
1319
|
+
declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
|
|
1320
|
+
declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
|
|
983
1321
|
|
|
984
1322
|
declare const PRECISION = 10000;
|
|
985
|
-
declare const
|
|
986
|
-
declare const INITIAL_SHIP_DRAIN = 25;
|
|
987
|
-
declare const INITIAL_SHIP_ENERGY = 350;
|
|
988
|
-
declare const INITIAL_SHIP_HULLMASS = 100000;
|
|
989
|
-
declare const INITIAL_SHIP_CAPACITY = 500000;
|
|
990
|
-
declare const INITIAL_SHIP_Z = 800;
|
|
991
|
-
declare const INITIAL_SHIP_RECHARGE = 10;
|
|
992
|
-
declare const INITIAL_SHIP_THRUST = 250;
|
|
993
|
-
declare const INITIAL_LOADER_MASS = 1000;
|
|
994
|
-
declare const INITIAL_LOADER_QUANTITY = 1;
|
|
995
|
-
declare const INITIAL_LOADER_THRUST = 1;
|
|
1323
|
+
declare const CRAFT_ENERGY_DIVISOR = 150000;
|
|
996
1324
|
declare const WAREHOUSE_Z = 500;
|
|
997
|
-
declare const INITIAL_WAREHOUSE_CAPACITY = 10000000;
|
|
998
1325
|
declare const CONTAINER_Z = 300;
|
|
999
|
-
declare const INITIAL_CONTAINER_HULLMASS = 50000;
|
|
1000
|
-
declare const INITIAL_CONTAINER_CAPACITY = 2000000;
|
|
1001
1326
|
declare const TRAVEL_MAX_DURATION = 86400;
|
|
1002
1327
|
declare const MIN_ORBITAL_ALTITUDE = 800;
|
|
1003
1328
|
declare const MAX_ORBITAL_ALTITUDE = 3000;
|
|
1004
|
-
declare const
|
|
1005
|
-
declare const INITIAL_EXTRACTOR_RATE = 700;
|
|
1006
|
-
declare const INITIAL_EXTRACTOR_DRAIN = 2500;
|
|
1007
|
-
declare const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
|
|
1329
|
+
declare const BASE_ORBITAL_MASS = 100000;
|
|
1008
1330
|
interface ShipLike {
|
|
1009
1331
|
coordinates: Types.coordinates;
|
|
1010
|
-
hullmass
|
|
1011
|
-
energy
|
|
1012
|
-
engines
|
|
1013
|
-
generator
|
|
1014
|
-
loaders
|
|
1015
|
-
|
|
1332
|
+
hullmass?: UInt32;
|
|
1333
|
+
energy?: UInt16;
|
|
1334
|
+
engines?: Types.movement_stats;
|
|
1335
|
+
generator?: Types.energy_stats;
|
|
1336
|
+
loaders?: Types.loader_stats;
|
|
1337
|
+
hauler?: Types.hauler_stats;
|
|
1338
|
+
capacity?: UInt32;
|
|
1016
1339
|
}
|
|
1017
1340
|
interface CargoMassInfo {
|
|
1018
|
-
|
|
1341
|
+
item_id: UInt16Type;
|
|
1019
1342
|
quantity: UInt32Type;
|
|
1020
1343
|
}
|
|
1021
1344
|
declare enum TaskType {
|
|
@@ -1024,7 +1347,12 @@ declare enum TaskType {
|
|
|
1024
1347
|
RECHARGE = 2,
|
|
1025
1348
|
LOAD = 3,
|
|
1026
1349
|
UNLOAD = 4,
|
|
1027
|
-
|
|
1350
|
+
GATHER = 5,
|
|
1351
|
+
WARP = 6,
|
|
1352
|
+
CRAFT = 7,
|
|
1353
|
+
DEPLOY = 8,
|
|
1354
|
+
WRAP = 9,
|
|
1355
|
+
UNWRAP = 10
|
|
1028
1356
|
}
|
|
1029
1357
|
declare enum LocationType {
|
|
1030
1358
|
EMPTY = 0,
|
|
@@ -1058,18 +1386,20 @@ interface Distance {
|
|
|
1058
1386
|
destination: ActionParams.Type.coordinates;
|
|
1059
1387
|
distance: UInt16;
|
|
1060
1388
|
}
|
|
1061
|
-
|
|
1389
|
+
type ResourceCategory = 'ore' | 'crystal' | 'gas' | 'regolith' | 'biomass';
|
|
1390
|
+
type ResourceTier = 't1' | 't2' | 't3' | 't4' | 't5';
|
|
1391
|
+
declare const TIER_ADJECTIVES: Record<number, string>;
|
|
1392
|
+
declare const CATEGORY_LABELS: Record<ResourceCategory, string>;
|
|
1393
|
+
declare function tierNumber(tier: string): number;
|
|
1394
|
+
declare class Item extends Struct {
|
|
1062
1395
|
id: UInt16;
|
|
1063
1396
|
name: string;
|
|
1064
1397
|
description: string;
|
|
1065
|
-
base_price: UInt32;
|
|
1066
1398
|
mass: UInt32;
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
price: UInt32;
|
|
1072
|
-
supply: UInt16;
|
|
1399
|
+
category: ResourceCategory;
|
|
1400
|
+
tier: ResourceTier;
|
|
1401
|
+
color: string;
|
|
1402
|
+
get displayName(): string;
|
|
1073
1403
|
}
|
|
1074
1404
|
|
|
1075
1405
|
interface EpochInfo {
|
|
@@ -1158,265 +1488,161 @@ declare class GameState extends Types.state_row {
|
|
|
1158
1488
|
|
|
1159
1489
|
interface PlayerStateInput {
|
|
1160
1490
|
owner: NameType;
|
|
1161
|
-
balance: UInt64Type;
|
|
1162
|
-
debt: UInt32Type;
|
|
1163
|
-
networth: Int64Type;
|
|
1164
1491
|
}
|
|
1165
|
-
/**
|
|
1166
|
-
* Player helper class extending player_row with computed financial properties.
|
|
1167
|
-
* Provides easy access to balance, debt, networth, and loan calculations.
|
|
1168
|
-
*/
|
|
1169
1492
|
declare class Player extends Types.player_row {
|
|
1170
|
-
/**
|
|
1171
|
-
* Construct a Player instance from individual state pieces.
|
|
1172
|
-
* Used by UI's ReactivePlayer to reconstruct Player from reactive state.
|
|
1173
|
-
*/
|
|
1174
1493
|
static fromState(state: PlayerStateInput): Player;
|
|
1175
|
-
private static readonly MAX_LOAN;
|
|
1176
|
-
private static readonly BASE_SHIP_COST;
|
|
1177
|
-
private static readonly SHIP_COST_MULTIPLIER;
|
|
1178
|
-
private _shipCount?;
|
|
1179
|
-
/**
|
|
1180
|
-
* Set the current ship count (needed for nextShipCost calculation)
|
|
1181
|
-
*/
|
|
1182
|
-
setShipCount(count: number): void;
|
|
1183
|
-
/**
|
|
1184
|
-
* Get the current ship count (if set)
|
|
1185
|
-
*/
|
|
1186
|
-
get shipCount(): number | undefined;
|
|
1187
|
-
/**
|
|
1188
|
-
* Calculate the cost of the next ship based on current ship count
|
|
1189
|
-
* Matches contract: pow(5, sequence) * 100
|
|
1190
|
-
* @param shipCount - Optional ship count (uses cached value if not provided)
|
|
1191
|
-
*/
|
|
1192
|
-
getNextShipCost(shipCount?: number): UInt64;
|
|
1193
|
-
/**
|
|
1194
|
-
* Get the cost of the next ship based on cached ship count
|
|
1195
|
-
*/
|
|
1196
|
-
get nextShipCost(): UInt64;
|
|
1197
|
-
/**
|
|
1198
|
-
* Check if player can afford to buy a ship
|
|
1199
|
-
* @param shipCount - Optional ship count (uses cached value if not provided)
|
|
1200
|
-
*/
|
|
1201
|
-
canBuyShip(shipCount?: number): boolean;
|
|
1202
|
-
/**
|
|
1203
|
-
* Calculate available loan amount (max loan - current debt)
|
|
1204
|
-
*/
|
|
1205
|
-
get availableLoan(): UInt64;
|
|
1206
|
-
/**
|
|
1207
|
-
* Check if player can take out a loan
|
|
1208
|
-
*/
|
|
1209
|
-
get canTakeLoan(): boolean;
|
|
1210
|
-
/**
|
|
1211
|
-
* Check if player can pay back loan
|
|
1212
|
-
*/
|
|
1213
|
-
get canPayLoan(): boolean;
|
|
1214
|
-
/**
|
|
1215
|
-
* Calculate maximum payback amount (min of debt and balance)
|
|
1216
|
-
*/
|
|
1217
|
-
get maxPayback(): UInt64;
|
|
1218
|
-
/**
|
|
1219
|
-
* Get the maximum loan amount (constant)
|
|
1220
|
-
*/
|
|
1221
|
-
static get MAX_LOAN_LIMIT(): number;
|
|
1222
|
-
/**
|
|
1223
|
-
* Check if player is in debt
|
|
1224
|
-
*/
|
|
1225
|
-
get hasDebt(): boolean;
|
|
1226
|
-
/**
|
|
1227
|
-
* Check if player is solvent (positive networth)
|
|
1228
|
-
*/
|
|
1229
|
-
get isSolvent(): boolean;
|
|
1230
|
-
/**
|
|
1231
|
-
* Create an optimistic update for balance changes
|
|
1232
|
-
* Uses integer math to match contract
|
|
1233
|
-
* @param delta - Amount to change (can be negative)
|
|
1234
|
-
*/
|
|
1235
|
-
withBalanceChange(delta: UInt64 | number): Player;
|
|
1236
|
-
/**
|
|
1237
|
-
* Create an optimistic update for debt changes
|
|
1238
|
-
* Uses integer math to match contract
|
|
1239
|
-
* @param delta - Amount to change (can be negative)
|
|
1240
|
-
*/
|
|
1241
|
-
withDebtChange(delta: UInt64 | number): Player;
|
|
1242
|
-
/**
|
|
1243
|
-
* Create an optimistic update for taking a loan
|
|
1244
|
-
*/
|
|
1245
|
-
withLoan(amount: UInt64): Player;
|
|
1246
|
-
/**
|
|
1247
|
-
* Create an optimistic update for paying back a loan
|
|
1248
|
-
*/
|
|
1249
|
-
withLoanPayment(amount: UInt64): Player;
|
|
1250
|
-
/**
|
|
1251
|
-
* Simulate networth update from selling goods.
|
|
1252
|
-
* Matches contract: networth += (sellPrice - paid * quantity)
|
|
1253
|
-
* Contract reference: market.cpp:75
|
|
1254
|
-
*
|
|
1255
|
-
* @param sellPrice - Total revenue from sale (price * quantity)
|
|
1256
|
-
* @param paidPerUnit - Average cost per unit paid (from cargo.paid)
|
|
1257
|
-
* @param quantity - Quantity being sold
|
|
1258
|
-
* @returns New player with updated networth
|
|
1259
|
-
*
|
|
1260
|
-
* @example
|
|
1261
|
-
* // Sold 10 units at 150 each (revenue=1500), paid 100 per unit
|
|
1262
|
-
* const newPlayer = player.withSaleNetworth(
|
|
1263
|
-
* UInt64.from(1500),
|
|
1264
|
-
* UInt64.from(100),
|
|
1265
|
-
* UInt32.from(10)
|
|
1266
|
-
* )
|
|
1267
|
-
* // Networth increases by: 1500 - (100*10) = 500
|
|
1268
|
-
*/
|
|
1269
|
-
withSaleNetworth(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
|
|
1270
|
-
/**
|
|
1271
|
-
* Simulate complete sell goods transaction.
|
|
1272
|
-
* Updates both balance (adds revenue) and networth (adds profit).
|
|
1273
|
-
* Matches contract actions: update_balance + update_networth
|
|
1274
|
-
*
|
|
1275
|
-
* @param sellPrice - Total revenue from sale (price * quantity)
|
|
1276
|
-
* @param paidPerUnit - Average cost per unit paid (from cargo.paid)
|
|
1277
|
-
* @param quantity - Quantity being sold
|
|
1278
|
-
* @returns New player with updated balance and networth
|
|
1279
|
-
*/
|
|
1280
|
-
withSellGoods(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
|
|
1281
|
-
/**
|
|
1282
|
-
* Simulate complete buy goods transaction.
|
|
1283
|
-
* Updates balance (subtracts cost).
|
|
1284
|
-
*
|
|
1285
|
-
* @param purchaseCost - Total cost of purchase (price * quantity)
|
|
1286
|
-
* @returns New player with updated balance
|
|
1287
|
-
*/
|
|
1288
|
-
withBuyGoods(purchaseCost: UInt64): Player;
|
|
1289
1494
|
}
|
|
1290
1495
|
|
|
1291
1496
|
declare class PlayersManager extends BaseManager {
|
|
1292
1497
|
getPlayer(account: NameType): Promise<Player | undefined>;
|
|
1293
1498
|
}
|
|
1294
1499
|
|
|
1295
|
-
/**
|
|
1296
|
-
* Location helper class for working with game coordinates.
|
|
1297
|
-
* Provides system detection, market price caching, nearby planet finding, and supply tracking.
|
|
1298
|
-
*/
|
|
1299
|
-
declare class Location {
|
|
1300
|
-
readonly coordinates: Coordinates;
|
|
1301
|
-
private _marketPrices?;
|
|
1302
|
-
private _gameSeed?;
|
|
1303
|
-
private _hasSystem?;
|
|
1304
|
-
private _locationRows?;
|
|
1305
|
-
private _epoch?;
|
|
1306
|
-
constructor(coordinates: CoordinatesType);
|
|
1307
|
-
/**
|
|
1308
|
-
* Create a Location from coordinates
|
|
1309
|
-
*/
|
|
1310
|
-
static from(coordinates: CoordinatesType): Location;
|
|
1311
|
-
/**
|
|
1312
|
-
* Check if this location has a system (planet, asteroid, or nebula)
|
|
1313
|
-
*/
|
|
1314
|
-
hasSystemAt(gameSeed: Checksum256Type): boolean;
|
|
1315
|
-
/**
|
|
1316
|
-
* Get the location type (EMPTY, PLANET, ASTEROID, or NEBULA)
|
|
1317
|
-
*/
|
|
1318
|
-
getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
|
|
1319
|
-
/**
|
|
1320
|
-
* Check if this location is extractable (asteroid or nebula)
|
|
1321
|
-
*/
|
|
1322
|
-
isExtractableAt(gameSeed: Checksum256Type): boolean;
|
|
1323
|
-
/**
|
|
1324
|
-
* Set cached market prices for this location
|
|
1325
|
-
*/
|
|
1326
|
-
setMarketPrices(prices: GoodPrice[]): void;
|
|
1327
|
-
/**
|
|
1328
|
-
* Get cached market prices (returns undefined if not cached)
|
|
1329
|
-
*/
|
|
1330
|
-
get marketPrices(): GoodPrice[] | undefined;
|
|
1331
|
-
/**
|
|
1332
|
-
* Get price for a specific good (from cache)
|
|
1333
|
-
*/
|
|
1334
|
-
getPrice(goodId: UInt16Type): GoodPrice | undefined;
|
|
1335
|
-
/**
|
|
1336
|
-
* Find nearby planets from this location
|
|
1337
|
-
*/
|
|
1338
|
-
findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
|
|
1339
|
-
/**
|
|
1340
|
-
* Check if this location equals another location
|
|
1341
|
-
*/
|
|
1342
|
-
equals(other: CoordinatesType | Location): boolean;
|
|
1343
|
-
/**
|
|
1344
|
-
* Set location rows (supply data) for this location
|
|
1345
|
-
*/
|
|
1346
|
-
setLocationRows(rows: Types.supply_row[], epoch: UInt64): void;
|
|
1347
|
-
/**
|
|
1348
|
-
* Get cached location rows (supply data)
|
|
1349
|
-
*/
|
|
1350
|
-
get locationRows(): Types.supply_row[] | undefined;
|
|
1351
|
-
/**
|
|
1352
|
-
* Get supply for a specific good at this location
|
|
1353
|
-
* Returns undefined if location rows not cached or good not found
|
|
1354
|
-
*/
|
|
1355
|
-
getSupply(goodId: UInt16Type): UInt16 | undefined;
|
|
1356
|
-
/**
|
|
1357
|
-
* Get all available goods at this location (goods with supply > 0)
|
|
1358
|
-
* Returns undefined if location rows not cached
|
|
1359
|
-
*/
|
|
1360
|
-
get availableGoods(): Types.supply_row[] | undefined;
|
|
1361
|
-
/**
|
|
1362
|
-
* Check if a specific good is available (has supply)
|
|
1363
|
-
* Returns false if location rows not cached
|
|
1364
|
-
*/
|
|
1365
|
-
hasGood(goodId: UInt16Type): boolean;
|
|
1366
|
-
/**
|
|
1367
|
-
* Get the epoch for cached location data
|
|
1368
|
-
*/
|
|
1369
|
-
get epoch(): UInt64 | undefined;
|
|
1370
|
-
/**
|
|
1371
|
-
* Check if cached data exists
|
|
1372
|
-
*/
|
|
1373
|
-
get hasCachedData(): boolean;
|
|
1374
|
-
/**
|
|
1375
|
-
* Check if supply data is cached
|
|
1376
|
-
*/
|
|
1377
|
-
get hasSupplyData(): boolean;
|
|
1378
|
-
/**
|
|
1379
|
-
* Clear all cached data
|
|
1380
|
-
*/
|
|
1381
|
-
clearCache(): void;
|
|
1382
|
-
/**
|
|
1383
|
-
* Create optimistic Location with updated supply after purchase/sale.
|
|
1384
|
-
* Matches contract: update_location_supply (delta can be positive or negative)
|
|
1385
|
-
* Contract reference: market.cpp:53, 123-151
|
|
1386
|
-
*
|
|
1387
|
-
* @param goodId - Good ID to update supply for
|
|
1388
|
-
* @param quantityDelta - Change in supply (negative for purchase, positive for sale)
|
|
1389
|
-
* @returns New Location with updated supply in cached data
|
|
1390
|
-
*
|
|
1391
|
-
* @example
|
|
1392
|
-
* // After buying 10 units (supply decreases)
|
|
1393
|
-
* const newLocation = location.withUpdatedSupply(1, -10)
|
|
1394
|
-
*
|
|
1395
|
-
* // After selling 5 units (supply increases)
|
|
1396
|
-
* const newLocation = location.withUpdatedSupply(1, 5)
|
|
1397
|
-
*/
|
|
1398
|
-
withUpdatedSupply(goodId: UInt16Type, quantityDelta: number): Location;
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Helper function to convert various coordinate types to Location
|
|
1402
|
-
*/
|
|
1403
|
-
declare function toLocation(coords: CoordinatesType | Location): Location;
|
|
1404
|
-
|
|
1405
1500
|
declare class LocationsManager extends BaseManager {
|
|
1406
|
-
getMarketPrice(location: CoordinatesType, goodId: number): Promise<GoodPrice>;
|
|
1407
|
-
getMarketPrices(location: CoordinatesType): Promise<GoodPrice[]>;
|
|
1408
|
-
getMarketPricesWithSupply(location: CoordinatesType): Promise<GoodPrice[]>;
|
|
1409
1501
|
hasSystem(location: CoordinatesType): Promise<boolean>;
|
|
1410
1502
|
findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
|
|
1411
|
-
getSupplyRows(location: CoordinatesType): Promise<any[]>;
|
|
1412
|
-
getLocationWithPrices(coords: CoordinatesType): Promise<Location>;
|
|
1413
|
-
getLocationWithSupply(coords: CoordinatesType): Promise<Location>;
|
|
1414
|
-
getLocationComplete(coords: CoordinatesType): Promise<Location>;
|
|
1415
1503
|
getLocationEntity(id: UInt64Type): Promise<Types.location_row | undefined>;
|
|
1416
1504
|
getLocationEntityAt(coords: CoordinatesType): Promise<Types.location_row | undefined>;
|
|
1417
1505
|
getAllLocationEntities(): Promise<Types.location_row[]>;
|
|
1418
1506
|
}
|
|
1419
1507
|
|
|
1508
|
+
declare class EpochsManager extends BaseManager {
|
|
1509
|
+
getCurrentHeight(): Promise<UInt64>;
|
|
1510
|
+
getCurrent(): Promise<EpochInfo>;
|
|
1511
|
+
getByHeight(height: UInt64Type): Promise<EpochInfo>;
|
|
1512
|
+
getTimeRemaining(): Promise<number>;
|
|
1513
|
+
getProgress(): Promise<number>;
|
|
1514
|
+
fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
type EntityRefInput = {
|
|
1518
|
+
entityType: EntityTypeName;
|
|
1519
|
+
entityId: UInt64Type;
|
|
1520
|
+
};
|
|
1521
|
+
declare class ActionsManager extends BaseManager {
|
|
1522
|
+
travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
|
|
1523
|
+
grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
|
|
1524
|
+
resolve(entityId: UInt64Type, entityType?: EntityTypeName, count?: UInt64Type): Action;
|
|
1525
|
+
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1526
|
+
recharge(entityId: UInt64Type, entityType?: EntityTypeName): Action;
|
|
1527
|
+
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, itemId: UInt64Type, stats: UInt64Type, quantity: UInt64Type): Action;
|
|
1528
|
+
foundCompany(account: NameType, name: string): Action;
|
|
1529
|
+
join(account: NameType): Action;
|
|
1530
|
+
gather(source: EntityRefInput, destination: EntityRefInput, stratum: UInt16Type, quantity: UInt32Type): Action;
|
|
1531
|
+
warp(entityId: UInt64Type, destination: CoordinatesType, entityType?: EntityTypeName): Action;
|
|
1532
|
+
craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
1533
|
+
blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
|
|
1534
|
+
deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, stats: bigint): Action;
|
|
1535
|
+
addmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, moduleCargoId: UInt64Type, targetCargoId?: UInt64Type): Action;
|
|
1536
|
+
rmmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, targetCargoId?: UInt64Type): Action;
|
|
1537
|
+
wrap(owner: NameType, entityType: EntityTypeName, entityId: UInt64Type, cargoId: UInt64Type, quantity: UInt64Type): Action;
|
|
1538
|
+
joinGame(account: NameType, companyName: string): Action[];
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
type EntityInfo = Types.entity_info;
|
|
1542
|
+
interface BoundingBox {
|
|
1543
|
+
min_x: number;
|
|
1544
|
+
min_y: number;
|
|
1545
|
+
max_x: number;
|
|
1546
|
+
max_y: number;
|
|
1547
|
+
}
|
|
1548
|
+
interface WireCoordinates {
|
|
1549
|
+
x: number;
|
|
1550
|
+
y: number;
|
|
1551
|
+
z?: number;
|
|
1552
|
+
}
|
|
1553
|
+
type SubscribeMessage = {
|
|
1554
|
+
type: 'subscribe';
|
|
1555
|
+
sub_id: string;
|
|
1556
|
+
bounds?: BoundingBox;
|
|
1557
|
+
owner?: string;
|
|
1558
|
+
prioritize_owner?: string;
|
|
1559
|
+
};
|
|
1560
|
+
type UpdateBoundsMessage = {
|
|
1561
|
+
type: 'update_bounds';
|
|
1562
|
+
sub_id: string;
|
|
1563
|
+
bounds: BoundingBox;
|
|
1564
|
+
};
|
|
1565
|
+
type UnsubscribeMessage = {
|
|
1566
|
+
type: 'unsubscribe';
|
|
1567
|
+
sub_id: string;
|
|
1568
|
+
};
|
|
1569
|
+
type SubscribeEntityMessage = {
|
|
1570
|
+
type: 'subscribe_entity';
|
|
1571
|
+
sub_id: string;
|
|
1572
|
+
entity_type: 'ship' | 'warehouse' | 'container';
|
|
1573
|
+
entity_id: string;
|
|
1574
|
+
};
|
|
1575
|
+
type UnsubscribeEntityMessage = {
|
|
1576
|
+
type: 'unsubscribe_entity';
|
|
1577
|
+
sub_id: string;
|
|
1578
|
+
};
|
|
1579
|
+
type SubscribeEventsMessage = {
|
|
1580
|
+
type: 'subscribe_events';
|
|
1581
|
+
sub_id: string;
|
|
1582
|
+
event_filter?: Record<string, unknown>;
|
|
1583
|
+
};
|
|
1584
|
+
type UnsubscribeEventsMessage = {
|
|
1585
|
+
type: 'unsubscribe_events';
|
|
1586
|
+
sub_id: string;
|
|
1587
|
+
};
|
|
1588
|
+
type PingMessage = {
|
|
1589
|
+
type: 'ping';
|
|
1590
|
+
};
|
|
1591
|
+
type ClientMessage = SubscribeMessage | UpdateBoundsMessage | UnsubscribeMessage | SubscribeEntityMessage | UnsubscribeEntityMessage | SubscribeEventsMessage | UnsubscribeEventsMessage | PingMessage;
|
|
1592
|
+
type AckMessage = {
|
|
1593
|
+
type: 'subscribed' | 'unsubscribed' | 'bounds_updated';
|
|
1594
|
+
sub_id: string;
|
|
1595
|
+
};
|
|
1596
|
+
type WireEntity = Record<string, unknown> & {
|
|
1597
|
+
type: number;
|
|
1598
|
+
type_name: 'ship' | 'warehouse' | 'container';
|
|
1599
|
+
id: string | number;
|
|
1600
|
+
owner: string;
|
|
1601
|
+
coordinates: WireCoordinates;
|
|
1602
|
+
};
|
|
1603
|
+
type SnapshotMessage = {
|
|
1604
|
+
type: 'snapshot';
|
|
1605
|
+
sub_id: string;
|
|
1606
|
+
seq: number;
|
|
1607
|
+
entities: WireEntity[];
|
|
1608
|
+
truncated?: boolean;
|
|
1609
|
+
};
|
|
1610
|
+
type UpdateMessage = {
|
|
1611
|
+
type: 'update';
|
|
1612
|
+
sub_ids: string[];
|
|
1613
|
+
entity_id: number;
|
|
1614
|
+
entity: WireEntity;
|
|
1615
|
+
seq: number;
|
|
1616
|
+
};
|
|
1617
|
+
type BoundsDeltaMessage = {
|
|
1618
|
+
type: 'bounds_delta';
|
|
1619
|
+
sub_id: string;
|
|
1620
|
+
entered: WireEntity[];
|
|
1621
|
+
exited: number[];
|
|
1622
|
+
seq: number;
|
|
1623
|
+
truncated?: boolean;
|
|
1624
|
+
};
|
|
1625
|
+
type EventMessage = {
|
|
1626
|
+
type: 'event';
|
|
1627
|
+
sub_id: string;
|
|
1628
|
+
catchup: boolean;
|
|
1629
|
+
events: Array<Record<string, unknown>>;
|
|
1630
|
+
seq?: number;
|
|
1631
|
+
};
|
|
1632
|
+
type EventCatchupCompleteMessage = {
|
|
1633
|
+
type: 'event_catchup_complete';
|
|
1634
|
+
sub_id: string;
|
|
1635
|
+
};
|
|
1636
|
+
type PongMessage = {
|
|
1637
|
+
type: 'pong';
|
|
1638
|
+
};
|
|
1639
|
+
type ErrorMessage = {
|
|
1640
|
+
type: 'error';
|
|
1641
|
+
error: string;
|
|
1642
|
+
sub_id?: string;
|
|
1643
|
+
};
|
|
1644
|
+
type ServerMessage = AckMessage | SnapshotMessage | UpdateMessage | BoundsDeltaMessage | EventMessage | EventCatchupCompleteMessage | PongMessage | ErrorMessage;
|
|
1645
|
+
|
|
1420
1646
|
interface MovementCapability {
|
|
1421
1647
|
engines: Types.movement_stats;
|
|
1422
1648
|
generator: Types.energy_stats;
|
|
@@ -1432,11 +1658,8 @@ interface StorageCapability {
|
|
|
1432
1658
|
interface LoaderCapability {
|
|
1433
1659
|
loaders: Types.loader_stats;
|
|
1434
1660
|
}
|
|
1435
|
-
interface
|
|
1436
|
-
|
|
1437
|
-
}
|
|
1438
|
-
interface ExtractorCapability {
|
|
1439
|
-
extractor: Types.extractor_stats;
|
|
1661
|
+
interface GathererCapability {
|
|
1662
|
+
gatherer: Types.gatherer_stats;
|
|
1440
1663
|
}
|
|
1441
1664
|
interface MassCapability {
|
|
1442
1665
|
hullmass: UInt32;
|
|
@@ -1450,8 +1673,9 @@ interface EntityCapabilities {
|
|
|
1450
1673
|
engines?: Types.movement_stats;
|
|
1451
1674
|
generator?: Types.energy_stats;
|
|
1452
1675
|
loaders?: Types.loader_stats;
|
|
1453
|
-
|
|
1454
|
-
|
|
1676
|
+
gatherer?: Types.gatherer_stats;
|
|
1677
|
+
crafter?: Types.crafter_stats;
|
|
1678
|
+
hauler?: Types.hauler_stats;
|
|
1455
1679
|
}
|
|
1456
1680
|
interface EntityState {
|
|
1457
1681
|
owner: Name;
|
|
@@ -1463,9 +1687,45 @@ interface EntityState {
|
|
|
1463
1687
|
declare function capsHasMovement(caps: EntityCapabilities): boolean;
|
|
1464
1688
|
declare function capsHasStorage(caps: EntityCapabilities): boolean;
|
|
1465
1689
|
declare function capsHasLoaders(caps: EntityCapabilities): boolean;
|
|
1466
|
-
declare function
|
|
1467
|
-
declare function capsHasExtractor(caps: EntityCapabilities): boolean;
|
|
1690
|
+
declare function capsHasGatherer(caps: EntityCapabilities): boolean;
|
|
1468
1691
|
declare function capsHasMass(caps: EntityCapabilities): boolean;
|
|
1692
|
+
declare function capsHasHauler(caps: EntityCapabilities): boolean;
|
|
1693
|
+
|
|
1694
|
+
interface HasCargo {
|
|
1695
|
+
cargo: Types.cargo_item[];
|
|
1696
|
+
}
|
|
1697
|
+
interface HasCapacity {
|
|
1698
|
+
capacity: UInt32;
|
|
1699
|
+
}
|
|
1700
|
+
interface HasCargomass {
|
|
1701
|
+
cargomass: UInt32;
|
|
1702
|
+
}
|
|
1703
|
+
interface MassInput {
|
|
1704
|
+
item_id: UInt16;
|
|
1705
|
+
quantity: UInt32;
|
|
1706
|
+
modules: Types.module_entry[];
|
|
1707
|
+
}
|
|
1708
|
+
declare function calcCargoItemMass(item: MassInput): UInt64;
|
|
1709
|
+
declare function calcCargoMass(entity: HasCargo): UInt64;
|
|
1710
|
+
declare function calcStacksMass(stacks: CargoStack[]): UInt64;
|
|
1711
|
+
declare function availableCapacity$1(entity: StorageCapability): UInt64;
|
|
1712
|
+
declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
|
|
1713
|
+
declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
|
|
1714
|
+
declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
|
|
1715
|
+
declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
|
|
1716
|
+
declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
|
|
1717
|
+
interface CargoStack {
|
|
1718
|
+
item_id: UInt16;
|
|
1719
|
+
quantity: UInt32;
|
|
1720
|
+
stats: UInt64;
|
|
1721
|
+
modules: Types.module_entry[];
|
|
1722
|
+
}
|
|
1723
|
+
declare function cargoItemToStack(item: Types.cargo_item): CargoStack;
|
|
1724
|
+
declare function stackToCargoItem(stack: CargoStack): Types.cargo_item;
|
|
1725
|
+
declare function stackKey(s: CargoStack): string;
|
|
1726
|
+
declare function stacksEqual(a: CargoStack, b: CargoStack): boolean;
|
|
1727
|
+
declare function mergeStacks(stacks: CargoStack[], add: CargoStack): CargoStack[];
|
|
1728
|
+
declare function removeFromStacks(stacks: CargoStack[], remove: CargoStack): CargoStack[];
|
|
1469
1729
|
|
|
1470
1730
|
type Schedule = Types.schedule;
|
|
1471
1731
|
type Task$1 = Types.task;
|
|
@@ -1513,7 +1773,7 @@ declare function isInFlight(entity: ScheduleData, now: Date): boolean;
|
|
|
1513
1773
|
declare function isRecharging(entity: ScheduleData, now: Date): boolean;
|
|
1514
1774
|
declare function isLoading(entity: ScheduleData, now: Date): boolean;
|
|
1515
1775
|
declare function isUnloading(entity: ScheduleData, now: Date): boolean;
|
|
1516
|
-
declare function
|
|
1776
|
+
declare function isGathering(entity: ScheduleData, now: Date): boolean;
|
|
1517
1777
|
|
|
1518
1778
|
type schedule_ScheduleData = ScheduleData;
|
|
1519
1779
|
type schedule_Scheduleable = Scheduleable;
|
|
@@ -1538,7 +1798,7 @@ declare const schedule_isInFlight: typeof isInFlight;
|
|
|
1538
1798
|
declare const schedule_isRecharging: typeof isRecharging;
|
|
1539
1799
|
declare const schedule_isLoading: typeof isLoading;
|
|
1540
1800
|
declare const schedule_isUnloading: typeof isUnloading;
|
|
1541
|
-
declare const
|
|
1801
|
+
declare const schedule_isGathering: typeof isGathering;
|
|
1542
1802
|
declare namespace schedule {
|
|
1543
1803
|
export {
|
|
1544
1804
|
schedule_ScheduleData as ScheduleData,
|
|
@@ -1565,25 +1825,25 @@ declare namespace schedule {
|
|
|
1565
1825
|
schedule_isRecharging as isRecharging,
|
|
1566
1826
|
schedule_isLoading as isLoading,
|
|
1567
1827
|
schedule_isUnloading as isUnloading,
|
|
1568
|
-
|
|
1828
|
+
schedule_isGathering as isGathering,
|
|
1569
1829
|
};
|
|
1570
1830
|
}
|
|
1571
1831
|
|
|
1572
1832
|
interface ProjectedEntity {
|
|
1573
1833
|
location: Coordinates;
|
|
1574
1834
|
energy: UInt16;
|
|
1575
|
-
|
|
1835
|
+
cargo: CargoStack[];
|
|
1576
1836
|
shipMass: UInt32;
|
|
1577
1837
|
capacity?: UInt64;
|
|
1578
1838
|
engines?: Types.movement_stats;
|
|
1579
1839
|
loaders?: Types.loader_stats;
|
|
1580
1840
|
generator?: Types.energy_stats;
|
|
1581
|
-
|
|
1841
|
+
hauler?: Types.hauler_stats;
|
|
1842
|
+
readonly cargoMass: UInt64;
|
|
1582
1843
|
readonly totalMass: UInt64;
|
|
1583
1844
|
hasMovement(): boolean;
|
|
1584
1845
|
hasStorage(): boolean;
|
|
1585
1846
|
hasLoaders(): boolean;
|
|
1586
|
-
hasTrade(): boolean;
|
|
1587
1847
|
capabilities(): EntityCapabilities;
|
|
1588
1848
|
state(): EntityState;
|
|
1589
1849
|
}
|
|
@@ -1594,16 +1854,37 @@ interface Projectable extends ScheduleData {
|
|
|
1594
1854
|
generator?: Types.energy_stats;
|
|
1595
1855
|
engines?: Types.movement_stats;
|
|
1596
1856
|
loaders?: Types.loader_stats;
|
|
1597
|
-
|
|
1857
|
+
hauler?: Types.hauler_stats;
|
|
1598
1858
|
capacity?: UInt32;
|
|
1599
1859
|
cargo: Types.cargo_item[];
|
|
1600
1860
|
cargomass: UInt32;
|
|
1601
1861
|
owner?: Name;
|
|
1602
1862
|
}
|
|
1603
1863
|
declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
|
|
1604
|
-
|
|
1864
|
+
interface ProjectionOptions {
|
|
1865
|
+
upToTaskIndex?: number;
|
|
1866
|
+
}
|
|
1867
|
+
declare function projectEntity(entity: Projectable, options?: ProjectionOptions): ProjectedEntity;
|
|
1868
|
+
declare function validateSchedule(entity: Projectable): void;
|
|
1605
1869
|
declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
|
|
1606
1870
|
|
|
1871
|
+
declare class Location {
|
|
1872
|
+
readonly coordinates: Coordinates;
|
|
1873
|
+
private _gameSeed?;
|
|
1874
|
+
private _hasSystem?;
|
|
1875
|
+
private _epoch?;
|
|
1876
|
+
constructor(coordinates: CoordinatesType);
|
|
1877
|
+
static from(coordinates: CoordinatesType): Location;
|
|
1878
|
+
hasSystemAt(gameSeed: Checksum256Type): boolean;
|
|
1879
|
+
getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
|
|
1880
|
+
isGatherableAt(gameSeed: Checksum256Type): boolean;
|
|
1881
|
+
findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
|
|
1882
|
+
equals(other: CoordinatesType | Location): boolean;
|
|
1883
|
+
get epoch(): UInt64 | undefined;
|
|
1884
|
+
clearCache(): void;
|
|
1885
|
+
}
|
|
1886
|
+
declare function toLocation(coords: CoordinatesType | Location): Location;
|
|
1887
|
+
|
|
1607
1888
|
type Task = Types.task;
|
|
1608
1889
|
declare class ScheduleAccessor {
|
|
1609
1890
|
private entity;
|
|
@@ -1629,99 +1910,33 @@ declare class ScheduleAccessor {
|
|
|
1629
1910
|
declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
|
|
1630
1911
|
|
|
1631
1912
|
declare class EntityInventory extends Types.cargo_item {
|
|
1632
|
-
private
|
|
1633
|
-
get
|
|
1913
|
+
private _item?;
|
|
1914
|
+
get item(): Item;
|
|
1915
|
+
get good(): Item;
|
|
1634
1916
|
get name(): string;
|
|
1635
1917
|
get unitMass(): UInt32;
|
|
1636
1918
|
get totalMass(): UInt64;
|
|
1637
|
-
get totalCost(): UInt64;
|
|
1638
1919
|
get hasCargo(): boolean;
|
|
1639
1920
|
get isEmpty(): boolean;
|
|
1640
1921
|
}
|
|
1641
1922
|
|
|
1642
|
-
interface HasCargo {
|
|
1643
|
-
cargo: Types.cargo_item[];
|
|
1644
|
-
}
|
|
1645
|
-
interface HasCapacity {
|
|
1646
|
-
capacity: UInt32;
|
|
1647
|
-
}
|
|
1648
|
-
interface HasCargomass {
|
|
1649
|
-
cargomass: UInt32;
|
|
1650
|
-
}
|
|
1651
|
-
declare function calcCargoMass(entity: HasCargo): UInt64;
|
|
1652
|
-
declare function calcCargoValue(entity: HasCargo): UInt64;
|
|
1653
|
-
declare function availableCapacity$1(entity: StorageCapability): UInt64;
|
|
1654
|
-
declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
|
|
1655
|
-
declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
|
|
1656
|
-
declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
|
|
1657
|
-
declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
|
|
1658
|
-
declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
|
|
1659
|
-
|
|
1660
1923
|
declare class InventoryAccessor {
|
|
1661
1924
|
private readonly entity;
|
|
1662
1925
|
private _items?;
|
|
1663
1926
|
constructor(entity: HasCargo);
|
|
1664
1927
|
get items(): EntityInventory[];
|
|
1665
1928
|
get totalMass(): UInt64;
|
|
1666
|
-
|
|
1667
|
-
forGood(goodId: UInt64Type): EntityInventory | undefined;
|
|
1929
|
+
forItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
1668
1930
|
get sellable(): EntityInventory[];
|
|
1669
1931
|
get hasSellable(): boolean;
|
|
1670
1932
|
get sellableCount(): number;
|
|
1671
1933
|
}
|
|
1672
1934
|
declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
|
|
1673
1935
|
|
|
1674
|
-
interface
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
|
|
1678
|
-
declare function cargoValue(cargo: EntityInventory[]): UInt64;
|
|
1679
|
-
declare function getCargoForGood(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
|
|
1680
|
-
declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
|
|
1681
|
-
declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
|
|
1682
|
-
declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
|
|
1683
|
-
interface SaleValue {
|
|
1684
|
-
revenue: UInt64;
|
|
1685
|
-
profit: UInt64;
|
|
1686
|
-
cost: UInt64;
|
|
1687
|
-
}
|
|
1688
|
-
declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
|
|
1689
|
-
declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
|
|
1690
|
-
declare function afterSellGoods(cargo: Types.cargo_item[], goodsToSell: Array<{
|
|
1691
|
-
goodId: number;
|
|
1692
|
-
quantity: number;
|
|
1693
|
-
}>): EntityInventory[];
|
|
1694
|
-
declare function afterSellAllGoods(cargo: Types.cargo_item[]): EntityInventory[];
|
|
1695
|
-
|
|
1696
|
-
type cargoUtils_CargoData = CargoData;
|
|
1697
|
-
declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
|
|
1698
|
-
declare const cargoUtils_cargoValue: typeof cargoValue;
|
|
1699
|
-
declare const cargoUtils_getCargoForGood: typeof getCargoForGood;
|
|
1700
|
-
declare const cargoUtils_hasSpace: typeof hasSpace;
|
|
1701
|
-
declare const cargoUtils_availableCapacity: typeof availableCapacity;
|
|
1702
|
-
declare const cargoUtils_isFull: typeof isFull;
|
|
1703
|
-
type cargoUtils_SaleValue = SaleValue;
|
|
1704
|
-
declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
|
|
1705
|
-
declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
|
|
1706
|
-
declare const cargoUtils_afterSellGoods: typeof afterSellGoods;
|
|
1707
|
-
declare const cargoUtils_afterSellAllGoods: typeof afterSellAllGoods;
|
|
1708
|
-
declare namespace cargoUtils {
|
|
1709
|
-
export {
|
|
1710
|
-
cargoUtils_CargoData as CargoData,
|
|
1711
|
-
cargoUtils_totalCargoMass as totalCargoMass,
|
|
1712
|
-
cargoUtils_cargoValue as cargoValue,
|
|
1713
|
-
cargoUtils_getCargoForGood as getCargoForGood,
|
|
1714
|
-
cargoUtils_hasSpace as hasSpace,
|
|
1715
|
-
cargoUtils_availableCapacity as availableCapacity,
|
|
1716
|
-
cargoUtils_isFull as isFull,
|
|
1717
|
-
cargoUtils_SaleValue as SaleValue,
|
|
1718
|
-
cargoUtils_calculateSaleValue as calculateSaleValue,
|
|
1719
|
-
cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
|
|
1720
|
-
cargoUtils_afterSellGoods as afterSellGoods,
|
|
1721
|
-
cargoUtils_afterSellAllGoods as afterSellAllGoods,
|
|
1722
|
-
};
|
|
1936
|
+
interface PackedModuleInput {
|
|
1937
|
+
itemId: UInt16Type;
|
|
1938
|
+
stats: UInt64Type;
|
|
1723
1939
|
}
|
|
1724
|
-
|
|
1725
1940
|
interface ShipStateInput {
|
|
1726
1941
|
id: UInt64Type;
|
|
1727
1942
|
owner: string;
|
|
@@ -1731,12 +1946,10 @@ interface ShipStateInput {
|
|
|
1731
1946
|
y: number;
|
|
1732
1947
|
z?: number;
|
|
1733
1948
|
};
|
|
1734
|
-
hullmass
|
|
1735
|
-
capacity
|
|
1736
|
-
energy
|
|
1737
|
-
|
|
1738
|
-
generator: Types.energy_stats;
|
|
1739
|
-
loaders: Types.loader_stats;
|
|
1949
|
+
hullmass?: number;
|
|
1950
|
+
capacity?: number;
|
|
1951
|
+
energy?: number;
|
|
1952
|
+
modules?: PackedModuleInput[];
|
|
1740
1953
|
schedule?: Types.schedule;
|
|
1741
1954
|
cargo?: Types.cargo_item[];
|
|
1742
1955
|
}
|
|
@@ -1756,18 +1969,20 @@ declare class Ship extends Types.entity_info {
|
|
|
1756
1969
|
isRecharging(now: Date): boolean;
|
|
1757
1970
|
isLoading(now: Date): boolean;
|
|
1758
1971
|
isUnloading(now: Date): boolean;
|
|
1759
|
-
|
|
1760
|
-
get
|
|
1972
|
+
isGathering(now: Date): boolean;
|
|
1973
|
+
get hasEngines(): boolean;
|
|
1974
|
+
get hasGenerator(): boolean;
|
|
1975
|
+
get hasGatherer(): boolean;
|
|
1976
|
+
get hasWarp(): boolean;
|
|
1761
1977
|
project(): ProjectedEntity;
|
|
1762
1978
|
projectAt(now: Date): ProjectedEntity;
|
|
1763
1979
|
get location(): Location;
|
|
1764
1980
|
get totalCargoMass(): UInt64;
|
|
1765
|
-
get cargoValue(): UInt64;
|
|
1766
1981
|
get totalMass(): UInt64;
|
|
1767
1982
|
get maxCapacity(): UInt64;
|
|
1768
1983
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
1769
1984
|
get availableCapacity(): UInt64;
|
|
1770
|
-
|
|
1985
|
+
getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
1771
1986
|
get sellableCargo(): EntityInventory[];
|
|
1772
1987
|
get hasSellableCargo(): boolean;
|
|
1773
1988
|
get sellableGoodsCount(): number;
|
|
@@ -1775,439 +1990,6 @@ declare class Ship extends Types.entity_info {
|
|
|
1775
1990
|
get energyPercent(): number;
|
|
1776
1991
|
get needsRecharge(): boolean;
|
|
1777
1992
|
hasEnergyFor(distance: UInt64): boolean;
|
|
1778
|
-
calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
|
|
1779
|
-
calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
|
|
1780
|
-
afterSellGoods(goodsToSell: Array<{
|
|
1781
|
-
goodId: number;
|
|
1782
|
-
quantity: number;
|
|
1783
|
-
}>): EntityInventory[];
|
|
1784
|
-
afterSellAllGoods(): EntityInventory[];
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* Travel calculations for ship movement, energy usage, and flight times.
|
|
1789
|
-
*
|
|
1790
|
-
* Functions prefixed with `calc_` are contract-parity functions that mirror
|
|
1791
|
-
* the C++ implementation in the server contract (schedule.cpp, ship.cpp).
|
|
1792
|
-
* These use snake_case intentionally to match the contract naming convention
|
|
1793
|
-
* and signal that they must produce identical results to the on-chain code.
|
|
1794
|
-
*
|
|
1795
|
-
* Functions prefixed with `calculate` are higher-level SDK helpers that may
|
|
1796
|
-
* combine multiple contract calculations for convenience.
|
|
1797
|
-
*/
|
|
1798
|
-
|
|
1799
|
-
declare function calc_orbital_altitude(mass: number): number;
|
|
1800
|
-
declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
|
|
1801
|
-
declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
|
|
1802
|
-
declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
|
|
1803
|
-
declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
|
|
1804
|
-
declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
|
|
1805
|
-
declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
|
|
1806
|
-
declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
|
|
1807
|
-
declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
|
|
1808
|
-
declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
|
|
1809
|
-
declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1810
|
-
declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
|
|
1811
|
-
declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
1812
|
-
declare function calc_acceleration(thrust: number, mass: number): number;
|
|
1813
|
-
declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
|
|
1814
|
-
declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
|
|
1815
|
-
declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
|
|
1816
|
-
declare function calculateRefuelingTime(ship: ShipLike): UInt32;
|
|
1817
|
-
declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
|
|
1818
|
-
interface LoadTimeBreakdown {
|
|
1819
|
-
unloadTime: number;
|
|
1820
|
-
loadTime: number;
|
|
1821
|
-
totalTime: number;
|
|
1822
|
-
unloadMass: number;
|
|
1823
|
-
loadMass: number;
|
|
1824
|
-
}
|
|
1825
|
-
declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
|
|
1826
|
-
interface EstimatedTravelTime {
|
|
1827
|
-
flightTime: UInt32;
|
|
1828
|
-
rechargeTime: UInt32;
|
|
1829
|
-
loadTime: UInt32;
|
|
1830
|
-
unloadTime: UInt32;
|
|
1831
|
-
total: UInt32;
|
|
1832
|
-
}
|
|
1833
|
-
interface EstimateTravelTimeOptions {
|
|
1834
|
-
needsRecharge?: boolean;
|
|
1835
|
-
loadMass?: UInt32Type;
|
|
1836
|
-
unloadMass?: UInt32Type;
|
|
1837
|
-
}
|
|
1838
|
-
declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
|
|
1839
|
-
declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
|
|
1840
|
-
declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
|
|
1841
|
-
interface TransferEntity {
|
|
1842
|
-
location: {
|
|
1843
|
-
z?: {
|
|
1844
|
-
toNumber(): number;
|
|
1845
|
-
} | number;
|
|
1846
|
-
};
|
|
1847
|
-
loaders?: {
|
|
1848
|
-
thrust: {
|
|
1849
|
-
toNumber(): number;
|
|
1850
|
-
} | number;
|
|
1851
|
-
mass: {
|
|
1852
|
-
toNumber(): number;
|
|
1853
|
-
} | number;
|
|
1854
|
-
quantity: {
|
|
1855
|
-
toNumber(): number;
|
|
1856
|
-
} | number;
|
|
1857
|
-
};
|
|
1858
|
-
}
|
|
1859
|
-
interface HasScheduleAndLocation {
|
|
1860
|
-
coordinates: ActionParams.Type.coordinates;
|
|
1861
|
-
schedule?: Types.schedule;
|
|
1862
|
-
}
|
|
1863
|
-
declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
|
|
1864
|
-
declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
|
|
1865
|
-
declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
|
|
1866
|
-
declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
|
|
1867
|
-
|
|
1868
|
-
/**
|
|
1869
|
-
* Trading deal interface representing a profitable trade opportunity
|
|
1870
|
-
*/
|
|
1871
|
-
interface Deal {
|
|
1872
|
-
/** Origin location */
|
|
1873
|
-
origin: Location;
|
|
1874
|
-
/** Destination location */
|
|
1875
|
-
destination: Location;
|
|
1876
|
-
/** Good to trade */
|
|
1877
|
-
good: GoodPrice;
|
|
1878
|
-
/** Distance between origin and destination */
|
|
1879
|
-
distance: UInt64;
|
|
1880
|
-
/** Available supply at origin */
|
|
1881
|
-
supply: UInt16;
|
|
1882
|
-
/** Buy price at origin */
|
|
1883
|
-
buyPrice: UInt32;
|
|
1884
|
-
/** Sell price at destination */
|
|
1885
|
-
sellPrice: UInt32;
|
|
1886
|
-
/** Profit per unit */
|
|
1887
|
-
profitPerUnit: UInt32;
|
|
1888
|
-
/** Maximum quantity that can be traded */
|
|
1889
|
-
maxQuantity: UInt32;
|
|
1890
|
-
/** Total profit for max quantity */
|
|
1891
|
-
totalProfit: Int64;
|
|
1892
|
-
/** Estimated travel time in seconds */
|
|
1893
|
-
travelTime: UInt32;
|
|
1894
|
-
/** Detailed breakdown of travel time components */
|
|
1895
|
-
travelTimeBreakdown: EstimatedTravelTime;
|
|
1896
|
-
/** Profit per second (floating point for UI display) */
|
|
1897
|
-
profitPerSecond: number;
|
|
1898
|
-
/** Profit margin percentage (floating point for UI display) */
|
|
1899
|
-
marginPercent: number;
|
|
1900
|
-
}
|
|
1901
|
-
/**
|
|
1902
|
-
* Options for finding deals
|
|
1903
|
-
*/
|
|
1904
|
-
interface FindDealsOptions {
|
|
1905
|
-
/** Maximum number of deals to return */
|
|
1906
|
-
maxDeals?: number;
|
|
1907
|
-
/** Maximum search distance */
|
|
1908
|
-
maxDistance?: number;
|
|
1909
|
-
/** Player's current balance (for affordability filtering) */
|
|
1910
|
-
playerBalance?: UInt64Type;
|
|
1911
|
-
/** Minimum profit per second threshold */
|
|
1912
|
-
minProfitPerSecond?: number;
|
|
1913
|
-
/** Minimum profit margin percentage */
|
|
1914
|
-
minMarginPercent?: number;
|
|
1915
|
-
/** Override available cargo space (in mass units). If provided, uses this instead of calculating from ship's current cargo. */
|
|
1916
|
-
availableSpace?: number;
|
|
1917
|
-
}
|
|
1918
|
-
/**
|
|
1919
|
-
* Calculate deals for a ship from a specific origin location
|
|
1920
|
-
*/
|
|
1921
|
-
declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
|
|
1922
|
-
/**
|
|
1923
|
-
* Find the single best deal for a ship from a specific origin location
|
|
1924
|
-
*/
|
|
1925
|
-
declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
|
|
1926
|
-
|
|
1927
|
-
/**
|
|
1928
|
-
* Types of collect actions available to the player
|
|
1929
|
-
*/
|
|
1930
|
-
type CollectActionType = 'sell-and-trade' | 'sell-and-reposition' | 'travel-to-sell' | 'sell-and-stay' | 'explore' | 'orbit';
|
|
1931
|
-
/**
|
|
1932
|
-
* Represents a single collect option presented to the player
|
|
1933
|
-
*/
|
|
1934
|
-
interface CollectOption {
|
|
1935
|
-
/** Unique identifier for this option */
|
|
1936
|
-
id: string;
|
|
1937
|
-
/** Type of action sequence */
|
|
1938
|
-
type: CollectActionType;
|
|
1939
|
-
/** Human-readable title */
|
|
1940
|
-
title: string;
|
|
1941
|
-
/** Detailed description of what will happen */
|
|
1942
|
-
description: string;
|
|
1943
|
-
/** Brief explanation of why this option is worth considering */
|
|
1944
|
-
reason: string;
|
|
1945
|
-
/** Whether this is the recommended option (best profitPerSecond with quality threshold) */
|
|
1946
|
-
recommended: boolean;
|
|
1947
|
-
/** Whether this option has the highest absolute profit (may differ from recommended) */
|
|
1948
|
-
highestProfit: boolean;
|
|
1949
|
-
/** Estimated profit/loss from this action */
|
|
1950
|
-
estimatedProfit: UInt64;
|
|
1951
|
-
/** Revenue from selling cargo (if applicable) */
|
|
1952
|
-
saleRevenue?: UInt64;
|
|
1953
|
-
/** Cost of purchasing new cargo (if applicable) */
|
|
1954
|
-
purchaseCost?: UInt64;
|
|
1955
|
-
/** Expected profit from the next trade (if applicable) */
|
|
1956
|
-
nextTradeProfit?: UInt64;
|
|
1957
|
-
/** Profit per second for this option (floating point for display) */
|
|
1958
|
-
profitPerSecond?: number;
|
|
1959
|
-
/** Margin percentage for the deal (floating point for display) */
|
|
1960
|
-
marginPercent?: number;
|
|
1961
|
-
/** Destination location (if traveling) */
|
|
1962
|
-
destination?: Location;
|
|
1963
|
-
/** Deal to execute (if buying goods) */
|
|
1964
|
-
deal?: Deal;
|
|
1965
|
-
/** Sale location if different from current */
|
|
1966
|
-
saleLocation?: Location;
|
|
1967
|
-
/** Price per unit at sale location */
|
|
1968
|
-
salePrice?: UInt32;
|
|
1969
|
-
/** Price per unit at current location (for comparison) */
|
|
1970
|
-
currentPrice?: UInt32;
|
|
1971
|
-
/** Estimated travel time in seconds (undefined = instant/no travel) */
|
|
1972
|
-
travelTime?: UInt32;
|
|
1973
|
-
/** Detailed breakdown of travel time components */
|
|
1974
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
1975
|
-
/** Info about a discounted good at the destination (for explore options) */
|
|
1976
|
-
discountedGood?: DiscountedGoodInfo;
|
|
1977
|
-
/** Top potential deals available at destination (for explore options) */
|
|
1978
|
-
potentialDeals?: PotentialDeal[];
|
|
1979
|
-
/** Details of cargo being sold (if selling cargo) */
|
|
1980
|
-
cargoSale?: CargoSaleItem[];
|
|
1981
|
-
/** Total profit/loss from selling cargo */
|
|
1982
|
-
cargoProfitLoss?: Int64;
|
|
1983
|
-
}
|
|
1984
|
-
/**
|
|
1985
|
-
* Analysis result for collect options
|
|
1986
|
-
*/
|
|
1987
|
-
interface CollectAnalysis {
|
|
1988
|
-
/** Current location where ship arrived */
|
|
1989
|
-
arrivedAt: Coordinates;
|
|
1990
|
-
/** Ship being analyzed */
|
|
1991
|
-
ship: Ship;
|
|
1992
|
-
/** Current cargo on ship */
|
|
1993
|
-
cargo: EntityInventory[];
|
|
1994
|
-
/** Value of cargo if sold at current location */
|
|
1995
|
-
cargoValueHere: UInt64;
|
|
1996
|
-
/** All available options, sorted by estimated profit */
|
|
1997
|
-
options: CollectOption[];
|
|
1998
|
-
/** Whether any profitable options exist */
|
|
1999
|
-
hasProfitableOptions: boolean;
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* Options for analyzing collect choices
|
|
2003
|
-
*/
|
|
2004
|
-
interface CollectAnalysisOptions {
|
|
2005
|
-
/** Player's current balance (defaults to Infinity) */
|
|
2006
|
-
playerBalance?: number;
|
|
2007
|
-
/** Maximum distance to search (defaults to ship's max range) */
|
|
2008
|
-
maxDistance?: number;
|
|
2009
|
-
/** Minimum profit improvement to suggest traveling elsewhere to sell */
|
|
2010
|
-
minSaleImprovement?: number;
|
|
2011
|
-
}
|
|
2012
|
-
/**
|
|
2013
|
-
* Find locations where current cargo could be sold for more
|
|
2014
|
-
*/
|
|
2015
|
-
interface BetterSaleLocation {
|
|
2016
|
-
location: Location;
|
|
2017
|
-
/** Price per unit at this location */
|
|
2018
|
-
price: UInt32;
|
|
2019
|
-
/** Total revenue if sold here */
|
|
2020
|
-
revenue: UInt64;
|
|
2021
|
-
/** Difference vs selling at current location */
|
|
2022
|
-
improvement: Int64;
|
|
2023
|
-
/** Best deal available at this location after selling */
|
|
2024
|
-
bestDealAfterSale?: Deal;
|
|
2025
|
-
/** Distance to this location */
|
|
2026
|
-
distance: UInt64;
|
|
2027
|
-
/** Estimated travel time */
|
|
2028
|
-
travelTime: UInt32;
|
|
2029
|
-
/** Detailed breakdown of travel time components */
|
|
2030
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
2031
|
-
}
|
|
2032
|
-
/**
|
|
2033
|
-
* Find locations with good deals when current location has none
|
|
2034
|
-
*/
|
|
2035
|
-
interface RepositionLocation {
|
|
2036
|
-
location: Location;
|
|
2037
|
-
/** Best deal available at this location */
|
|
2038
|
-
bestDeal: Deal;
|
|
2039
|
-
/** Distance to this location */
|
|
2040
|
-
distance: UInt64;
|
|
2041
|
-
/** Estimated travel time */
|
|
2042
|
-
travelTime: UInt32;
|
|
2043
|
-
/** Detailed breakdown of travel time components */
|
|
2044
|
-
travelTimeBreakdown?: EstimatedTravelTime;
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Analyze cargo sale value at a specific location
|
|
2048
|
-
*/
|
|
2049
|
-
declare function analyzeCargoSale(cargo: EntityInventory[], prices: Map<number, UInt64>): {
|
|
2050
|
-
revenue: UInt64;
|
|
2051
|
-
cost: UInt64;
|
|
2052
|
-
profit: Int64;
|
|
2053
|
-
};
|
|
2054
|
-
/**
|
|
2055
|
-
* Create a "Sell & Trade" option (full loop)
|
|
2056
|
-
*/
|
|
2057
|
-
declare function createSellAndTradeOption(saleRevenue: UInt64, saleCost: UInt64, deal: Deal, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
|
|
2058
|
-
/**
|
|
2059
|
-
* Create a "Travel to Sell" option (better market elsewhere)
|
|
2060
|
-
*/
|
|
2061
|
-
declare function createTravelToSellOption(currentRevenue: UInt64, cargoCost: UInt64, betterSale: BetterSaleLocation, cargo: EntityInventory[], destPrices?: Map<number, UInt64>): CollectOption;
|
|
2062
|
-
/**
|
|
2063
|
-
* Create a "Sell & Reposition" option (sell here, travel empty to deals)
|
|
2064
|
-
*/
|
|
2065
|
-
declare function createSellAndRepositionOption(saleRevenue: UInt64, saleCost: UInt64, reposition: RepositionLocation, cargoSale?: CargoSaleItem[]): CollectOption;
|
|
2066
|
-
/**
|
|
2067
|
-
* Create a "Sell & Stay" option (just sell, stay idle)
|
|
2068
|
-
*/
|
|
2069
|
-
declare function createSellAndStayOption(saleRevenue: UInt64, saleCost: UInt64, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
|
|
2070
|
-
/**
|
|
2071
|
-
* Details about a cargo item being sold
|
|
2072
|
-
*/
|
|
2073
|
-
interface CargoSaleItem {
|
|
2074
|
-
goodId: UInt16;
|
|
2075
|
-
goodName: string;
|
|
2076
|
-
quantity: UInt32;
|
|
2077
|
-
/** Price per unit at sale location */
|
|
2078
|
-
pricePerUnit: UInt32;
|
|
2079
|
-
/** Total revenue from this item */
|
|
2080
|
-
revenue: UInt64;
|
|
2081
|
-
/** Original cost (paid) per unit */
|
|
2082
|
-
costPerUnit: UInt64;
|
|
2083
|
-
/** Profit/loss on this item */
|
|
2084
|
-
profit: Int64;
|
|
2085
|
-
}
|
|
2086
|
-
/**
|
|
2087
|
-
* Info about a discounted good for explore options
|
|
2088
|
-
*/
|
|
2089
|
-
interface DiscountedGoodInfo {
|
|
2090
|
-
goodId: number;
|
|
2091
|
-
name: string;
|
|
2092
|
-
rarity: string;
|
|
2093
|
-
discountPercent: number;
|
|
2094
|
-
}
|
|
2095
|
-
/**
|
|
2096
|
-
* A potential deal available at a destination (for explore options)
|
|
2097
|
-
*/
|
|
2098
|
-
interface PotentialDeal {
|
|
2099
|
-
goodId: number;
|
|
2100
|
-
goodName: string;
|
|
2101
|
-
destinationCoords: Coordinates;
|
|
2102
|
-
marginPercent: number;
|
|
2103
|
-
profitPerSecond: number;
|
|
2104
|
-
}
|
|
2105
|
-
/**
|
|
2106
|
-
* Create an "Explore" option (travel to find opportunities)
|
|
2107
|
-
*/
|
|
2108
|
-
declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedGoodInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
|
|
2109
|
-
/**
|
|
2110
|
-
* Callbacks for collect analysis (provided by manager)
|
|
2111
|
-
*/
|
|
2112
|
-
interface CollectAnalysisCallbacks {
|
|
2113
|
-
getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
|
|
2114
|
-
getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>;
|
|
2115
|
-
getGameSeed?: () => Checksum256Type;
|
|
2116
|
-
getState?: () => Types.state_row;
|
|
2117
|
-
}
|
|
2118
|
-
/**
|
|
2119
|
-
* Analyze all collect options for a ship that has arrived at its destination.
|
|
2120
|
-
* Returns all available options sorted by estimated profit.
|
|
2121
|
-
*/
|
|
2122
|
-
declare function analyzeCollectOptions(ship: Ship, arrivedAt: Coordinates, callbacks: CollectAnalysisCallbacks, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
|
|
2123
|
-
|
|
2124
|
-
declare class TradesManager extends BaseManager {
|
|
2125
|
-
private priceCache;
|
|
2126
|
-
private priceCacheEpoch;
|
|
2127
|
-
private makePriceCacheKey;
|
|
2128
|
-
private createCallbacks;
|
|
2129
|
-
clearPriceCache(): void;
|
|
2130
|
-
findDeals(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal[]>;
|
|
2131
|
-
findBestDeal(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal | undefined>;
|
|
2132
|
-
getCollectOptions(ship: Ship, arrivedAt?: Coordinates, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
declare class EpochsManager extends BaseManager {
|
|
2136
|
-
getCurrentHeight(): Promise<UInt64>;
|
|
2137
|
-
getCurrent(): Promise<EpochInfo>;
|
|
2138
|
-
getByHeight(height: UInt64Type): Promise<EpochInfo>;
|
|
2139
|
-
getTimeRemaining(): Promise<number>;
|
|
2140
|
-
getProgress(): Promise<number>;
|
|
2141
|
-
fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
interface SellableCargo {
|
|
2145
|
-
good_id: {
|
|
2146
|
-
toNumber(): number;
|
|
2147
|
-
} | number;
|
|
2148
|
-
quantity: {
|
|
2149
|
-
toNumber(): number;
|
|
2150
|
-
} | number;
|
|
2151
|
-
hasCargo: boolean;
|
|
2152
|
-
}
|
|
2153
|
-
type EntityRefInput = {
|
|
2154
|
-
entityType: EntityTypeName;
|
|
2155
|
-
entityId: UInt64Type;
|
|
2156
|
-
};
|
|
2157
|
-
declare class ActionsManager extends BaseManager {
|
|
2158
|
-
travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
|
|
2159
|
-
grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
|
|
2160
|
-
resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2161
|
-
cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2162
|
-
recharge(shipId: UInt64Type): Action;
|
|
2163
|
-
transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
|
|
2164
|
-
buyGoods(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2165
|
-
sellGoods(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
|
|
2166
|
-
buyShip(account: NameType, name: string): Action;
|
|
2167
|
-
buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
2168
|
-
buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
|
|
2169
|
-
takeLoan(account: NameType, amount: UInt64Type): Action;
|
|
2170
|
-
payLoan(account: NameType, amount: UInt64Type): Action;
|
|
2171
|
-
foundCompany(account: NameType, name: string): Action;
|
|
2172
|
-
join(account: NameType): Action;
|
|
2173
|
-
extract(shipId: UInt64Type): Action;
|
|
2174
|
-
joinGame(account: NameType, companyName: string): Action[];
|
|
2175
|
-
sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
declare class GameContext {
|
|
2179
|
-
readonly client: APIClient;
|
|
2180
|
-
readonly server: Contract$2;
|
|
2181
|
-
readonly platform: Contract$2;
|
|
2182
|
-
private _entities?;
|
|
2183
|
-
private _players?;
|
|
2184
|
-
private _locations?;
|
|
2185
|
-
private _trades?;
|
|
2186
|
-
private _epochs?;
|
|
2187
|
-
private _actions?;
|
|
2188
|
-
private _gameCache?;
|
|
2189
|
-
private _stateCache?;
|
|
2190
|
-
constructor(client: APIClient, server: Contract$2, platform: Contract$2);
|
|
2191
|
-
get entities(): EntitiesManager;
|
|
2192
|
-
get players(): PlayersManager;
|
|
2193
|
-
get locations(): LocationsManager;
|
|
2194
|
-
get trades(): TradesManager;
|
|
2195
|
-
get epochs(): EpochsManager;
|
|
2196
|
-
get actions(): ActionsManager;
|
|
2197
|
-
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
2198
|
-
getState(reload?: boolean): Promise<GameState>;
|
|
2199
|
-
get cachedGame(): Types$1.game_row | undefined;
|
|
2200
|
-
get cachedState(): GameState | undefined;
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
declare abstract class BaseManager {
|
|
2204
|
-
protected readonly context: GameContext;
|
|
2205
|
-
constructor(context: GameContext);
|
|
2206
|
-
protected get client(): _wharfkit_antelope.APIClient;
|
|
2207
|
-
protected get server(): _wharfkit_contract.Contract;
|
|
2208
|
-
protected get platform(): _wharfkit_contract.Contract;
|
|
2209
|
-
protected getGame(): Promise<Types$1.game_row>;
|
|
2210
|
-
protected getState(): Promise<GameState>;
|
|
2211
1993
|
}
|
|
2212
1994
|
|
|
2213
1995
|
interface WarehouseStateInput {
|
|
@@ -2219,8 +2001,9 @@ interface WarehouseStateInput {
|
|
|
2219
2001
|
y: number;
|
|
2220
2002
|
z?: number;
|
|
2221
2003
|
};
|
|
2004
|
+
hullmass?: number;
|
|
2222
2005
|
capacity: number;
|
|
2223
|
-
|
|
2006
|
+
modules?: PackedModuleInput[];
|
|
2224
2007
|
schedule?: Types.schedule;
|
|
2225
2008
|
cargo?: Types.cargo_item[];
|
|
2226
2009
|
}
|
|
@@ -2236,14 +2019,24 @@ declare class Warehouse extends Types.entity_info {
|
|
|
2236
2019
|
isUnloading(now: Date): boolean;
|
|
2237
2020
|
get location(): Location;
|
|
2238
2021
|
get totalCargoMass(): UInt64;
|
|
2239
|
-
get cargoValue(): UInt64;
|
|
2240
2022
|
get maxCapacity(): UInt64;
|
|
2241
2023
|
get availableCapacity(): UInt64;
|
|
2242
2024
|
hasSpace(goodMass: UInt64, quantity: number): boolean;
|
|
2243
2025
|
get isFull(): boolean;
|
|
2244
|
-
|
|
2026
|
+
getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
|
|
2245
2027
|
get orbitalAltitude(): number;
|
|
2028
|
+
get totalMass(): UInt64;
|
|
2246
2029
|
}
|
|
2030
|
+
declare function computeWarehouseCapabilities(modules: {
|
|
2031
|
+
itemId: number;
|
|
2032
|
+
stats: bigint;
|
|
2033
|
+
}[]): {
|
|
2034
|
+
loaders?: {
|
|
2035
|
+
mass: number;
|
|
2036
|
+
thrust: number;
|
|
2037
|
+
quantity: number;
|
|
2038
|
+
};
|
|
2039
|
+
};
|
|
2247
2040
|
|
|
2248
2041
|
interface ContainerStateInput {
|
|
2249
2042
|
id: UInt64Type;
|
|
@@ -2257,6 +2050,7 @@ interface ContainerStateInput {
|
|
|
2257
2050
|
hullmass: number;
|
|
2258
2051
|
capacity: number;
|
|
2259
2052
|
cargomass?: number;
|
|
2053
|
+
cargo?: Types.cargo_item[];
|
|
2260
2054
|
schedule?: Types.schedule;
|
|
2261
2055
|
}
|
|
2262
2056
|
declare class Container extends Types.entity_info {
|
|
@@ -2274,6 +2068,97 @@ declare class Container extends Types.entity_info {
|
|
|
2274
2068
|
get isFull(): boolean;
|
|
2275
2069
|
get orbitalAltitude(): number;
|
|
2276
2070
|
}
|
|
2071
|
+
declare function computeContainerCapabilities(stats: Record<string, number>): {
|
|
2072
|
+
hullmass: number;
|
|
2073
|
+
capacity: number;
|
|
2074
|
+
};
|
|
2075
|
+
declare function computeContainerT2Capabilities(stats: Record<string, number>): {
|
|
2076
|
+
hullmass: number;
|
|
2077
|
+
capacity: number;
|
|
2078
|
+
};
|
|
2079
|
+
|
|
2080
|
+
type SubscriptionEntityType = 'ship' | 'warehouse' | 'container';
|
|
2081
|
+
type EntityInstance = Ship | Warehouse | Container;
|
|
2082
|
+
interface SubscriptionsOptions {
|
|
2083
|
+
url: string;
|
|
2084
|
+
}
|
|
2085
|
+
interface BoundsSubscriptionHandle {
|
|
2086
|
+
readonly subId: string;
|
|
2087
|
+
unsubscribe(): void;
|
|
2088
|
+
updateBounds(bounds: BoundingBox): void;
|
|
2089
|
+
current: Map<number, EntityInstance>;
|
|
2090
|
+
}
|
|
2091
|
+
interface EntitySubscriptionHandle {
|
|
2092
|
+
readonly subId: string;
|
|
2093
|
+
readonly entityType: SubscriptionEntityType;
|
|
2094
|
+
readonly entityId: string;
|
|
2095
|
+
unsubscribe(): void;
|
|
2096
|
+
current: EntityInstance | null;
|
|
2097
|
+
}
|
|
2098
|
+
declare class SubscriptionsManager {
|
|
2099
|
+
private readonly conn;
|
|
2100
|
+
private readonly entitySubs;
|
|
2101
|
+
private readonly boundsSubs;
|
|
2102
|
+
private subCounter;
|
|
2103
|
+
constructor(opts: SubscriptionsOptions);
|
|
2104
|
+
close(): void;
|
|
2105
|
+
private generateSubID;
|
|
2106
|
+
private sendMessage;
|
|
2107
|
+
subscribeEntity(type: SubscriptionEntityType, id: string, onUpdate: (e: EntityInstance) => void): EntitySubscriptionHandle;
|
|
2108
|
+
private unsubscribeEntity;
|
|
2109
|
+
subscribeBounds(bounds: BoundingBox, handlers: {
|
|
2110
|
+
onSnapshot?: (entities: EntityInstance[]) => void;
|
|
2111
|
+
onUpdate?: (entity: EntityInstance) => void;
|
|
2112
|
+
onBoundsDelta?: (entered: EntityInstance[], exited: number[]) => void;
|
|
2113
|
+
owner?: string;
|
|
2114
|
+
prioritizeOwner?: string;
|
|
2115
|
+
}): BoundsSubscriptionHandle;
|
|
2116
|
+
private unsubscribeBounds;
|
|
2117
|
+
private updateBounds;
|
|
2118
|
+
private onMessage;
|
|
2119
|
+
private parseEntity;
|
|
2120
|
+
private handleSnapshot;
|
|
2121
|
+
private handleUpdate;
|
|
2122
|
+
private handleBoundsDelta;
|
|
2123
|
+
private handleError;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
declare class GameContext {
|
|
2127
|
+
readonly client: APIClient;
|
|
2128
|
+
readonly server: Contract$2;
|
|
2129
|
+
readonly platform: Contract$2;
|
|
2130
|
+
private _entities?;
|
|
2131
|
+
private _players?;
|
|
2132
|
+
private _locations?;
|
|
2133
|
+
private _epochs?;
|
|
2134
|
+
private _actions?;
|
|
2135
|
+
private _subscriptions?;
|
|
2136
|
+
private _subscriptionsUrl?;
|
|
2137
|
+
private _gameCache?;
|
|
2138
|
+
private _stateCache?;
|
|
2139
|
+
constructor(client: APIClient, server: Contract$2, platform: Contract$2);
|
|
2140
|
+
get entities(): EntitiesManager;
|
|
2141
|
+
get players(): PlayersManager;
|
|
2142
|
+
get locations(): LocationsManager;
|
|
2143
|
+
get epochs(): EpochsManager;
|
|
2144
|
+
get actions(): ActionsManager;
|
|
2145
|
+
setSubscriptionsUrl(url: string): void;
|
|
2146
|
+
get subscriptions(): SubscriptionsManager;
|
|
2147
|
+
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
2148
|
+
getState(reload?: boolean): Promise<GameState>;
|
|
2149
|
+
get cachedGame(): Types$1.game_row | undefined;
|
|
2150
|
+
get cachedState(): GameState | undefined;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
declare abstract class BaseManager {
|
|
2154
|
+
protected readonly context: GameContext;
|
|
2155
|
+
constructor(context: GameContext);
|
|
2156
|
+
protected get client(): _wharfkit_antelope.APIClient;
|
|
2157
|
+
protected get server(): _wharfkit_contract.Contract;
|
|
2158
|
+
protected get platform(): _wharfkit_contract.Contract;
|
|
2159
|
+
protected getGame(): Promise<Types$1.game_row>;
|
|
2160
|
+
protected getState(): Promise<GameState>;
|
|
2161
|
+
}
|
|
2277
2162
|
|
|
2278
2163
|
type EntityType = 'ship' | 'warehouse' | 'container' | 'location';
|
|
2279
2164
|
declare class EntitiesManager extends BaseManager {
|
|
@@ -2297,6 +2182,7 @@ interface ShiploadOptions {
|
|
|
2297
2182
|
platformContractName?: string;
|
|
2298
2183
|
serverContractName?: string;
|
|
2299
2184
|
client?: APIClient;
|
|
2185
|
+
subscriptionsUrl?: string;
|
|
2300
2186
|
}
|
|
2301
2187
|
interface ShiploadConstructorOptions extends ShiploadOptions {
|
|
2302
2188
|
platformContract?: Contract$2;
|
|
@@ -2312,9 +2198,9 @@ declare class Shipload {
|
|
|
2312
2198
|
get entities(): EntitiesManager;
|
|
2313
2199
|
get players(): PlayersManager;
|
|
2314
2200
|
get locations(): LocationsManager;
|
|
2315
|
-
get trades(): TradesManager;
|
|
2316
2201
|
get epochs(): EpochsManager;
|
|
2317
2202
|
get actions(): ActionsManager;
|
|
2203
|
+
get subscriptions(): SubscriptionsManager;
|
|
2318
2204
|
getGame(reload?: boolean): Promise<Types$1.game_row>;
|
|
2319
2205
|
getState(reload?: boolean): Promise<GameState>;
|
|
2320
2206
|
}
|
|
@@ -2323,118 +2209,272 @@ declare function makeShip(state: ShipStateInput): Ship;
|
|
|
2323
2209
|
declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
|
|
2324
2210
|
declare function makeContainer(state: ContainerStateInput): Container;
|
|
2325
2211
|
|
|
2326
|
-
declare const
|
|
2327
|
-
declare function
|
|
2328
|
-
declare function
|
|
2329
|
-
|
|
2330
|
-
declare enum Rarities {
|
|
2331
|
-
legendary = "LEGENDARY",
|
|
2332
|
-
epic = "EPIC",
|
|
2333
|
-
rare = "RARE",
|
|
2334
|
-
uncommon = "UNCOMMON",
|
|
2335
|
-
common = "COMMON",
|
|
2336
|
-
trash = "TRASH"
|
|
2337
|
-
}
|
|
2338
|
-
interface Rarity {
|
|
2339
|
-
rarity: Rarities;
|
|
2340
|
-
minMultiplier: number;
|
|
2341
|
-
maxMultiplier: number;
|
|
2342
|
-
}
|
|
2343
|
-
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): GoodPrice;
|
|
2345
|
-
declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice[];
|
|
2212
|
+
declare const itemIds: UInt16[];
|
|
2213
|
+
declare function getItem(itemId: UInt16Type): Item;
|
|
2214
|
+
declare function getItems(): Item[];
|
|
2346
2215
|
|
|
2347
2216
|
declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
|
|
2348
|
-
declare function
|
|
2217
|
+
declare function isGatherableLocation(locationType: LocationType): boolean;
|
|
2218
|
+
declare function getLocationTypeName(type: LocationType): string;
|
|
2349
2219
|
declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
|
|
2350
2220
|
declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
|
|
2351
2221
|
declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
|
|
2352
2222
|
declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
|
|
2353
2223
|
declare function deriveLocation(gameSeed: Checksum256Type, epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_derived;
|
|
2354
|
-
declare function deriveLocationMixture(location: Types.location_derived, epochSeed: Checksum256Type): Types.mixture_info;
|
|
2355
2224
|
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
interface
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
}
|
|
2225
|
+
interface StratumInfo {
|
|
2226
|
+
itemId: number;
|
|
2227
|
+
seed: bigint;
|
|
2228
|
+
richness: number;
|
|
2229
|
+
reserve: number;
|
|
2230
|
+
}
|
|
2231
|
+
interface ResourceStats {
|
|
2232
|
+
stat1: number;
|
|
2233
|
+
stat2: number;
|
|
2234
|
+
stat3: number;
|
|
2235
|
+
}
|
|
2236
|
+
declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
|
|
2369
2237
|
/**
|
|
2370
|
-
*
|
|
2371
|
-
*
|
|
2238
|
+
* Derives the three stat values for a raw resource from a deposit's
|
|
2239
|
+
* entropy seed (hash-based, weibull-transformed).
|
|
2372
2240
|
*
|
|
2373
|
-
*
|
|
2374
|
-
*
|
|
2375
|
-
*
|
|
2376
|
-
*
|
|
2377
|
-
* @returns New weighted average cost per unit
|
|
2241
|
+
* **Use only on deposit seeds** — the bigint returned by `deriveStratum`
|
|
2242
|
+
* or carried on a `MassDeposit`. Do NOT call this on a cargo item's
|
|
2243
|
+
* `stats` field; cargo stats are bit-packed and must be read via
|
|
2244
|
+
* `decodeStat` (or `decodeStackStats` for category-mapped output).
|
|
2378
2245
|
*
|
|
2379
|
-
*
|
|
2380
|
-
*
|
|
2381
|
-
* const newPaid = calculateUpdatedCargoCost(
|
|
2382
|
-
* UInt64.from(100),
|
|
2383
|
-
* UInt32.from(10),
|
|
2384
|
-
* UInt64.from(600),
|
|
2385
|
-
* UInt32.from(5)
|
|
2386
|
-
* )
|
|
2387
|
-
* // Result: (100*10 + 600) / (10+5) = 106.67 per unit
|
|
2246
|
+
* Passing a cargo `stats` value here produces meaningless output
|
|
2247
|
+
* (hash of the packed bits, unrelated to the actual stats).
|
|
2388
2248
|
*/
|
|
2389
|
-
declare function
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
declare
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2249
|
+
declare function deriveResourceStats(seed: bigint): ResourceStats;
|
|
2250
|
+
|
|
2251
|
+
declare function deriveLocationSize(loc: Types.location_static): number;
|
|
2252
|
+
|
|
2253
|
+
declare const DEPTH_THRESHOLD_T1 = 0;
|
|
2254
|
+
declare const DEPTH_THRESHOLD_T2 = 2000;
|
|
2255
|
+
declare const DEPTH_THRESHOLD_T3 = 10000;
|
|
2256
|
+
declare const DEPTH_THRESHOLD_T4 = 30000;
|
|
2257
|
+
declare const DEPTH_THRESHOLD_T5 = 55000;
|
|
2258
|
+
declare const LOCATION_MIN_DEPTH = 500;
|
|
2259
|
+
declare const LOCATION_MAX_DEPTH = 65535;
|
|
2260
|
+
declare const PLANET_SUBTYPE_GAS_GIANT = 0;
|
|
2261
|
+
declare const PLANET_SUBTYPE_ROCKY = 1;
|
|
2262
|
+
declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
|
|
2263
|
+
declare const PLANET_SUBTYPE_ICY = 3;
|
|
2264
|
+
declare const PLANET_SUBTYPE_OCEAN = 4;
|
|
2265
|
+
declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
|
|
2266
|
+
declare function getDepthThreshold(tier: ResourceTier): number;
|
|
2267
|
+
declare function getResourceTier(itemId: number): ResourceTier;
|
|
2268
|
+
declare function getResourceWeight(itemId: number, stratum: number): number;
|
|
2269
|
+
declare function getLocationCandidates(locationType: number, subtype: number): number[];
|
|
2270
|
+
declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
|
|
2271
|
+
|
|
2272
|
+
type ReserveTier = 'small' | 'medium' | 'large' | 'massive' | 'motherlode';
|
|
2273
|
+
interface TierRange {
|
|
2274
|
+
min: number;
|
|
2275
|
+
max: number;
|
|
2276
|
+
}
|
|
2277
|
+
declare const RESERVE_TIERS: Record<ReserveTier, TierRange>;
|
|
2278
|
+
declare const TIER_ROLL_MAX = 65536;
|
|
2279
|
+
declare function rollTier(tierRoll: number, stratum: number): ReserveTier;
|
|
2280
|
+
declare function rollWithinTier(withinRoll: number, range: TierRange): number;
|
|
2281
|
+
|
|
2282
|
+
interface StatDefinition {
|
|
2283
|
+
key: string;
|
|
2284
|
+
label: string;
|
|
2285
|
+
abbreviation: string;
|
|
2286
|
+
purpose: string;
|
|
2287
|
+
inverted?: boolean;
|
|
2288
|
+
}
|
|
2289
|
+
declare function getStatDefinitions(category: ResourceCategory): StatDefinition[];
|
|
2290
|
+
declare function getStatName(category: ResourceCategory, index: 0 | 1 | 2): StatDefinition;
|
|
2291
|
+
interface NamedStats {
|
|
2292
|
+
definitions: StatDefinition[];
|
|
2293
|
+
values: [number, number, number];
|
|
2294
|
+
}
|
|
2295
|
+
declare function resolveStats(category: ResourceCategory, stats: {
|
|
2296
|
+
stat1: number;
|
|
2297
|
+
stat2: number;
|
|
2298
|
+
stat3: number;
|
|
2299
|
+
}): NamedStats;
|
|
2300
|
+
|
|
2301
|
+
interface StackInput {
|
|
2302
|
+
quantity: number;
|
|
2303
|
+
stats: Record<string, number>;
|
|
2304
|
+
}
|
|
2305
|
+
interface CategoryStacks {
|
|
2306
|
+
category: ResourceCategory;
|
|
2307
|
+
stacks: StackInput[];
|
|
2308
|
+
}
|
|
2309
|
+
declare function encodeStats(values: number[]): bigint;
|
|
2310
|
+
declare function decodeStat(stats: bigint, index: number): number;
|
|
2311
|
+
declare function decodeStats(stats: bigint, count: number): number[];
|
|
2312
|
+
declare function decodeCraftedItemStats(itemId: number, stats: bigint): Record<string, number>;
|
|
2313
|
+
declare function blendStacks(stacks: StackInput[], statKey: string): number;
|
|
2314
|
+
declare function computeComponentStats(componentId: number, categoryStacks: CategoryStacks[]): {
|
|
2315
|
+
key: string;
|
|
2316
|
+
value: number;
|
|
2317
|
+
}[];
|
|
2318
|
+
declare function blendComponentStacks(stacks: {
|
|
2319
|
+
quantity: number;
|
|
2320
|
+
stats: Record<string, number>;
|
|
2321
|
+
}[]): Record<string, number>;
|
|
2322
|
+
declare function computeEntityStats(entityRecipeId: string, componentStacks: Record<number, {
|
|
2323
|
+
quantity: number;
|
|
2324
|
+
stats: Record<string, number>;
|
|
2325
|
+
}[]>): {
|
|
2326
|
+
key: string;
|
|
2327
|
+
value: number;
|
|
2328
|
+
}[];
|
|
2329
|
+
declare const categoryItemMass: Record<string, number>;
|
|
2330
|
+
declare function computeInputMass(itemId: string | number, itemType: 'component' | 'module' | 'entity'): number;
|
|
2331
|
+
declare function blendCrossGroup(sources: {
|
|
2332
|
+
value: number;
|
|
2333
|
+
weight: number;
|
|
2334
|
+
}[]): number;
|
|
2335
|
+
declare function blendCargoStacks(itemId: number, stacks: {
|
|
2336
|
+
quantity: number;
|
|
2337
|
+
stats: UInt64;
|
|
2338
|
+
}[]): UInt64;
|
|
2339
|
+
interface RecipeSlotInput {
|
|
2340
|
+
itemId: number;
|
|
2341
|
+
category: ResourceCategory | undefined;
|
|
2342
|
+
stacks: {
|
|
2343
|
+
quantity: number;
|
|
2344
|
+
stats: bigint;
|
|
2345
|
+
}[];
|
|
2403
2346
|
}
|
|
2347
|
+
declare function computeCraftedOutputStats(outputItemId: number, slotInputs: RecipeSlotInput[]): UInt64;
|
|
2404
2348
|
/**
|
|
2405
|
-
*
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
*
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
* Calculate profit per second for a trade route
|
|
2349
|
+
* Mirrors the contract's gather-time transform. Takes a deposit's entropy
|
|
2350
|
+
* seed (bigint from deriveStratum), derives stats via weibull hashing, and
|
|
2351
|
+
* returns a UInt64 whose bit-packed form matches what the contract writes
|
|
2352
|
+
* to cargo_item.stats on gather.
|
|
2353
|
+
*
|
|
2354
|
+
* Use this whenever off-chain code simulates a gather (testmap, player
|
|
2355
|
+
* scanners that project cargo outcomes) and needs a value that matches
|
|
2356
|
+
* what on-chain cargo would carry.
|
|
2414
2357
|
*/
|
|
2415
|
-
declare function
|
|
2358
|
+
declare function encodeGatheredCargoStats(depositSeed: bigint): UInt64;
|
|
2359
|
+
|
|
2360
|
+
declare function hash(seed: Checksum256Type, string: string): Checksum256;
|
|
2361
|
+
declare function hash512(seed: Checksum256Type, string: string): Checksum512;
|
|
2362
|
+
|
|
2416
2363
|
/**
|
|
2417
|
-
*
|
|
2364
|
+
* Travel calculations for ship movement, energy usage, and flight times.
|
|
2365
|
+
*
|
|
2366
|
+
* Functions prefixed with `calc_` are contract-parity functions that mirror
|
|
2367
|
+
* the C++ implementation in the server contract (schedule.cpp, ship.cpp).
|
|
2368
|
+
* These use snake_case intentionally to match the contract naming convention
|
|
2369
|
+
* and signal that they must produce identical results to the on-chain code.
|
|
2370
|
+
*
|
|
2371
|
+
* Functions prefixed with `calculate` are higher-level SDK helpers that may
|
|
2372
|
+
* combine multiple contract calculations for convenience.
|
|
2418
2373
|
*/
|
|
2419
|
-
|
|
2420
|
-
|
|
2374
|
+
|
|
2375
|
+
declare function calc_orbital_altitude(mass: number): number;
|
|
2376
|
+
declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
|
|
2377
|
+
declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
|
|
2378
|
+
declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
|
|
2379
|
+
declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
|
|
2380
|
+
declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
|
|
2381
|
+
declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
|
|
2382
|
+
declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
|
|
2383
|
+
declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
|
|
2384
|
+
declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
|
|
2385
|
+
declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
2386
|
+
declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
|
|
2387
|
+
declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
|
|
2388
|
+
declare function calc_acceleration(thrust: number, mass: number): number;
|
|
2389
|
+
declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
|
|
2390
|
+
declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
|
|
2391
|
+
declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
|
|
2392
|
+
declare function calculateRefuelingTime(ship: ShipLike): UInt32;
|
|
2393
|
+
declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
|
|
2394
|
+
interface LoadTimeBreakdown {
|
|
2395
|
+
unloadTime: number;
|
|
2396
|
+
loadTime: number;
|
|
2397
|
+
totalTime: number;
|
|
2398
|
+
unloadMass: number;
|
|
2399
|
+
loadMass: number;
|
|
2400
|
+
}
|
|
2401
|
+
declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
|
|
2402
|
+
interface EstimatedTravelTime {
|
|
2403
|
+
flightTime: UInt32;
|
|
2404
|
+
rechargeTime: UInt32;
|
|
2405
|
+
loadTime: UInt32;
|
|
2406
|
+
unloadTime: UInt32;
|
|
2407
|
+
total: UInt32;
|
|
2408
|
+
}
|
|
2409
|
+
interface EstimateTravelTimeOptions {
|
|
2410
|
+
needsRecharge?: boolean;
|
|
2411
|
+
loadMass?: UInt32Type;
|
|
2412
|
+
unloadMass?: UInt32Type;
|
|
2413
|
+
}
|
|
2414
|
+
declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
|
|
2415
|
+
declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
|
|
2416
|
+
declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
|
|
2417
|
+
interface TransferEntity {
|
|
2418
|
+
location: {
|
|
2419
|
+
z?: {
|
|
2420
|
+
toNumber(): number;
|
|
2421
|
+
} | number;
|
|
2422
|
+
};
|
|
2423
|
+
loaders?: {
|
|
2424
|
+
thrust: {
|
|
2425
|
+
toNumber(): number;
|
|
2426
|
+
} | number;
|
|
2427
|
+
mass: {
|
|
2428
|
+
toNumber(): number;
|
|
2429
|
+
} | number;
|
|
2430
|
+
quantity: {
|
|
2431
|
+
toNumber(): number;
|
|
2432
|
+
} | number;
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2435
|
+
interface HasScheduleAndLocation {
|
|
2436
|
+
coordinates: ActionParams.Type.coordinates;
|
|
2437
|
+
schedule?: Types.schedule;
|
|
2438
|
+
}
|
|
2439
|
+
declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
|
|
2440
|
+
declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
|
|
2441
|
+
declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
|
|
2442
|
+
declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
|
|
2443
|
+
|
|
2444
|
+
interface CargoData {
|
|
2445
|
+
cargo: EntityInventory[];
|
|
2446
|
+
}
|
|
2447
|
+
declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
|
|
2448
|
+
declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
|
|
2449
|
+
declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
|
|
2450
|
+
declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
|
|
2451
|
+
declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
|
|
2452
|
+
declare function afterRemoveItems(cargo: Types.cargo_item[], goodsToRemove: Array<{
|
|
2453
|
+
goodId: number;
|
|
2421
2454
|
quantity: number;
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
declare
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
declare
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2455
|
+
}>): EntityInventory[];
|
|
2456
|
+
declare function afterRemoveAllItems(cargo: Types.cargo_item[]): EntityInventory[];
|
|
2457
|
+
|
|
2458
|
+
type cargoUtils_CargoData = CargoData;
|
|
2459
|
+
declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
|
|
2460
|
+
declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
|
|
2461
|
+
declare const cargoUtils_hasSpace: typeof hasSpace;
|
|
2462
|
+
declare const cargoUtils_availableCapacity: typeof availableCapacity;
|
|
2463
|
+
declare const cargoUtils_isFull: typeof isFull;
|
|
2464
|
+
declare const cargoUtils_afterRemoveItems: typeof afterRemoveItems;
|
|
2465
|
+
declare const cargoUtils_afterRemoveAllItems: typeof afterRemoveAllItems;
|
|
2466
|
+
declare namespace cargoUtils {
|
|
2467
|
+
export {
|
|
2468
|
+
cargoUtils_CargoData as CargoData,
|
|
2469
|
+
cargoUtils_totalCargoMass as totalCargoMass,
|
|
2470
|
+
cargoUtils_getCargoForItem as getCargoForItem,
|
|
2471
|
+
cargoUtils_hasSpace as hasSpace,
|
|
2472
|
+
cargoUtils_availableCapacity as availableCapacity,
|
|
2473
|
+
cargoUtils_isFull as isFull,
|
|
2474
|
+
cargoUtils_afterRemoveItems as afterRemoveItems,
|
|
2475
|
+
cargoUtils_afterRemoveAllItems as afterRemoveAllItems,
|
|
2476
|
+
};
|
|
2477
|
+
}
|
|
2438
2478
|
|
|
2439
2479
|
interface Entity {
|
|
2440
2480
|
id: UInt64;
|
|
@@ -2443,11 +2483,10 @@ interface Entity {
|
|
|
2443
2483
|
entity_name: string;
|
|
2444
2484
|
location: Coordinates | Types.coordinates;
|
|
2445
2485
|
}
|
|
2446
|
-
type ShipEntity = Entity & MovementCapability & EnergyCapability & StorageCapability & LoaderCapability & MassCapability & ScheduleCapability & {
|
|
2447
|
-
|
|
2448
|
-
extractor?: Types.extractor_stats;
|
|
2486
|
+
type ShipEntity = Entity & Partial<MovementCapability> & Partial<EnergyCapability> & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability & {
|
|
2487
|
+
gatherer?: Types.gatherer_stats;
|
|
2449
2488
|
};
|
|
2450
|
-
type WarehouseEntity = Entity & StorageCapability & LoaderCapability & ScheduleCapability;
|
|
2489
|
+
type WarehouseEntity = Entity & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability;
|
|
2451
2490
|
type ContainerEntity = Entity & StorageCapability & MassCapability & ScheduleCapability;
|
|
2452
2491
|
type AnyEntity = ShipEntity | WarehouseEntity | ContainerEntity;
|
|
2453
2492
|
|
|
@@ -2455,10 +2494,9 @@ declare function canMove(e: Entity): e is Entity & MovementCapability & EnergyCa
|
|
|
2455
2494
|
declare function hasEnergy(e: Entity): e is Entity & EnergyCapability;
|
|
2456
2495
|
declare function hasStorage(e: Entity): e is Entity & StorageCapability;
|
|
2457
2496
|
declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
|
|
2458
|
-
declare function hasTrade(e: Entity): e is Entity & TradeCapability;
|
|
2459
2497
|
declare function hasMass(e: Entity): e is Entity & MassCapability;
|
|
2460
2498
|
declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
|
|
2461
|
-
declare function
|
|
2499
|
+
declare function hasGatherer(e: Entity): e is Entity & GathererCapability;
|
|
2462
2500
|
|
|
2463
2501
|
declare function maxTravelDistance(entity: MovementCapability): UInt32;
|
|
2464
2502
|
declare function calcEnergyUsage(entity: MovementCapability, distance: UInt64): UInt64;
|
|
@@ -2467,8 +2505,504 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
|
|
|
2467
2505
|
|
|
2468
2506
|
declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
|
|
2469
2507
|
|
|
2470
|
-
declare function
|
|
2471
|
-
declare function
|
|
2508
|
+
declare function calc_gather_duration(gatherer: Types.gatherer_stats, itemMass: number, quantity: number, stratum: number, richness: number): UInt32;
|
|
2509
|
+
declare function calc_gather_energy(gatherer: Types.gatherer_stats, duration: number): UInt16;
|
|
2510
|
+
|
|
2511
|
+
interface CrafterCapability {
|
|
2512
|
+
crafter: Types.crafter_stats;
|
|
2513
|
+
}
|
|
2514
|
+
declare function capsHasCrafter(caps: EntityCapabilities): boolean;
|
|
2515
|
+
declare function calc_craft_duration(speed: number, totalInputMass: number): UInt32;
|
|
2516
|
+
declare function calc_craft_energy(drain: number, totalInputMass: number): UInt16;
|
|
2517
|
+
|
|
2518
|
+
declare const ITEM_ENGINE_T1 = 10100;
|
|
2519
|
+
declare const ITEM_GENERATOR_T1 = 10101;
|
|
2520
|
+
declare const ITEM_GATHERER_T1 = 10102;
|
|
2521
|
+
declare const ITEM_LOADER_T1 = 10103;
|
|
2522
|
+
declare const ITEM_CRAFTER_T1 = 10104;
|
|
2523
|
+
declare const ITEM_STORAGE_T1 = 10105;
|
|
2524
|
+
declare const ITEM_HAULER_T1 = 10106;
|
|
2525
|
+
declare const MODULE_ANY = 0;
|
|
2526
|
+
declare const MODULE_ENGINE = 1;
|
|
2527
|
+
declare const MODULE_GENERATOR = 2;
|
|
2528
|
+
declare const MODULE_GATHERER = 3;
|
|
2529
|
+
declare const MODULE_LOADER = 4;
|
|
2530
|
+
declare const MODULE_WARP = 5;
|
|
2531
|
+
declare const MODULE_CRAFTER = 6;
|
|
2532
|
+
declare const MODULE_LAUNCHER = 7;
|
|
2533
|
+
declare const MODULE_STORAGE = 8;
|
|
2534
|
+
declare const MODULE_HAULER = 9;
|
|
2535
|
+
interface PackedModule {
|
|
2536
|
+
itemId: number;
|
|
2537
|
+
stats: bigint;
|
|
2538
|
+
}
|
|
2539
|
+
interface ModuleEntry {
|
|
2540
|
+
type: number;
|
|
2541
|
+
installed?: PackedModule;
|
|
2542
|
+
}
|
|
2543
|
+
declare function moduleAccepts(slotType: number, moduleType: number): boolean;
|
|
2544
|
+
declare function getModuleCapabilityType(itemId: number): number;
|
|
2545
|
+
declare function isModuleItem(itemId: number): boolean;
|
|
2546
|
+
|
|
2547
|
+
declare function computeHaulPenalty(totalThrust: number, haulCount: number, avgEfficiency: number): number;
|
|
2548
|
+
declare function computeHaulerDrain(distance: number, drain: number, haulCount: number): number;
|
|
2549
|
+
|
|
2550
|
+
declare const categoryColors: Record<ResourceCategory, string>;
|
|
2551
|
+
declare const tierColors: Record<ResourceTier, string>;
|
|
2552
|
+
declare const tierLabels: Record<ResourceTier, string>;
|
|
2553
|
+
declare const categoryIcons: Record<ResourceCategory, string>;
|
|
2554
|
+
type CategoryIconShape = 'hex' | 'diamond' | 'star' | 'circle' | 'square';
|
|
2555
|
+
declare const categoryIconShapes: Record<ResourceCategory, CategoryIconShape>;
|
|
2556
|
+
declare const componentIcon = "\u25A3";
|
|
2557
|
+
declare const moduleIcon = "\u2B22";
|
|
2558
|
+
declare const itemAbbreviations: Record<number, string>;
|
|
2559
|
+
|
|
2560
|
+
type CraftedItemCategory = 'component' | 'module' | 'entity' | 'resource';
|
|
2561
|
+
declare const ITEM_TYPE_RESOURCE = 0;
|
|
2562
|
+
declare const ITEM_TYPE_COMPONENT = 1;
|
|
2563
|
+
declare const ITEM_TYPE_MODULE = 2;
|
|
2564
|
+
declare const ITEM_TYPE_ENTITY = 3;
|
|
2565
|
+
declare function itemTypeCode(id: number): number;
|
|
2566
|
+
declare function itemTier(id: number): number;
|
|
2567
|
+
declare function itemOffset(id: number): number;
|
|
2568
|
+
declare function itemCategory(id: number): CraftedItemCategory;
|
|
2569
|
+
declare function isRelatedItem(a: number, b: number): boolean;
|
|
2570
|
+
declare function isCraftedItem(id: number): boolean;
|
|
2571
|
+
|
|
2572
|
+
interface CategoryInfo {
|
|
2573
|
+
id: ResourceCategory;
|
|
2574
|
+
name: string;
|
|
2575
|
+
label: string;
|
|
2576
|
+
description: string;
|
|
2577
|
+
color: string;
|
|
2578
|
+
}
|
|
2579
|
+
declare function getCategoryInfo(): CategoryInfo[];
|
|
2580
|
+
declare function getCategoryInfo(id: ResourceCategory): CategoryInfo | undefined;
|
|
2581
|
+
|
|
2582
|
+
interface PlanetSubtypeInfo {
|
|
2583
|
+
id: number;
|
|
2584
|
+
label: string;
|
|
2585
|
+
description: string;
|
|
2586
|
+
paletteType: string;
|
|
2587
|
+
}
|
|
2588
|
+
declare function getPlanetSubtypes(): PlanetSubtypeInfo[];
|
|
2589
|
+
declare function getPlanetSubtype(id: number): PlanetSubtypeInfo | undefined;
|
|
2590
|
+
|
|
2591
|
+
interface CapabilityAttribute {
|
|
2592
|
+
capability: string;
|
|
2593
|
+
attribute: string;
|
|
2594
|
+
description: string;
|
|
2595
|
+
}
|
|
2596
|
+
interface StatMapping {
|
|
2597
|
+
stat: string;
|
|
2598
|
+
capability: string;
|
|
2599
|
+
attribute: string;
|
|
2600
|
+
rationale: string;
|
|
2601
|
+
}
|
|
2602
|
+
declare const capabilityNames: string[];
|
|
2603
|
+
declare const capabilityAttributes: CapabilityAttribute[];
|
|
2604
|
+
declare const statMappings: StatMapping[];
|
|
2605
|
+
declare function isInvertedAttribute(attribute: string): boolean;
|
|
2606
|
+
declare function getCapabilityAttributes(capability?: string): CapabilityAttribute[];
|
|
2607
|
+
declare function getStatMappings(): StatMapping[];
|
|
2608
|
+
declare function getStatMappingsForStat(stat: string): StatMapping[];
|
|
2609
|
+
declare function getStatMappingsForCapability(capability: string): StatMapping[];
|
|
2610
|
+
|
|
2611
|
+
declare const ITEM_MATTER_CONDUIT = 10005;
|
|
2612
|
+
declare const ITEM_SURVEY_PROBE = 10006;
|
|
2613
|
+
declare const ITEM_CARGO_ARM = 10007;
|
|
2614
|
+
declare const ITEM_TOOL_BIT = 10008;
|
|
2615
|
+
declare const ITEM_REACTION_CHAMBER = 10009;
|
|
2616
|
+
declare const ITEM_FOCUSING_ARRAY = 10010;
|
|
2617
|
+
declare const ITEM_HULL_PLATES = 10001;
|
|
2618
|
+
declare const ITEM_CARGO_LINING = 10002;
|
|
2619
|
+
declare const ITEM_CONTAINER_T1_PACKED = 10200;
|
|
2620
|
+
declare const ITEM_THRUSTER_CORE = 10003;
|
|
2621
|
+
declare const ITEM_POWER_CELL = 10004;
|
|
2622
|
+
declare const ITEM_SHIP_T1_PACKED = 10201;
|
|
2623
|
+
declare const ITEM_WAREHOUSE_T1_PACKED = 10202;
|
|
2624
|
+
declare const ITEM_HULL_PLATES_T2 = 20001;
|
|
2625
|
+
declare const ITEM_CARGO_LINING_T2 = 20002;
|
|
2626
|
+
declare const ITEM_CONTAINER_T2_PACKED = 20200;
|
|
2627
|
+
interface RecipeInput {
|
|
2628
|
+
category?: ResourceCategory;
|
|
2629
|
+
itemId?: number;
|
|
2630
|
+
quantity: number;
|
|
2631
|
+
}
|
|
2632
|
+
interface ComponentStat {
|
|
2633
|
+
key: string;
|
|
2634
|
+
source: ResourceCategory;
|
|
2635
|
+
}
|
|
2636
|
+
interface ComponentDefinition {
|
|
2637
|
+
id: number;
|
|
2638
|
+
name: string;
|
|
2639
|
+
description: string;
|
|
2640
|
+
color: string;
|
|
2641
|
+
mass: number;
|
|
2642
|
+
stats: ComponentStat[];
|
|
2643
|
+
recipe: RecipeInput[];
|
|
2644
|
+
usedIn: {
|
|
2645
|
+
type: 'entity' | 'module';
|
|
2646
|
+
name: string;
|
|
2647
|
+
}[];
|
|
2648
|
+
}
|
|
2649
|
+
interface ModuleSlot {
|
|
2650
|
+
type: number;
|
|
2651
|
+
label?: string;
|
|
2652
|
+
}
|
|
2653
|
+
interface EntityRecipe {
|
|
2654
|
+
id: string;
|
|
2655
|
+
name: string;
|
|
2656
|
+
description: string;
|
|
2657
|
+
color: string;
|
|
2658
|
+
packedItemId: number;
|
|
2659
|
+
recipe: RecipeInput[];
|
|
2660
|
+
stats: {
|
|
2661
|
+
key: string;
|
|
2662
|
+
sourceComponentId: number;
|
|
2663
|
+
sourceStatKey: string;
|
|
2664
|
+
}[];
|
|
2665
|
+
moduleSlots?: ModuleSlot[];
|
|
2666
|
+
}
|
|
2667
|
+
interface CraftableItem {
|
|
2668
|
+
type: 'component' | 'entity' | 'module';
|
|
2669
|
+
id: number | string;
|
|
2670
|
+
name: string;
|
|
2671
|
+
description: string;
|
|
2672
|
+
color: string;
|
|
2673
|
+
}
|
|
2674
|
+
declare const components: ComponentDefinition[];
|
|
2675
|
+
declare const entityRecipes: EntityRecipe[];
|
|
2676
|
+
interface ModuleRecipe {
|
|
2677
|
+
id: string;
|
|
2678
|
+
name: string;
|
|
2679
|
+
description: string;
|
|
2680
|
+
color: string;
|
|
2681
|
+
itemId: number;
|
|
2682
|
+
moduleType: number;
|
|
2683
|
+
recipe: RecipeInput[];
|
|
2684
|
+
stats: {
|
|
2685
|
+
key: string;
|
|
2686
|
+
sourceComponentId: number;
|
|
2687
|
+
sourceStatKey: string;
|
|
2688
|
+
}[];
|
|
2689
|
+
}
|
|
2690
|
+
declare const moduleRecipes: ModuleRecipe[];
|
|
2691
|
+
declare function getModuleRecipe(id: string): ModuleRecipe | undefined;
|
|
2692
|
+
declare function getModuleRecipeByItemId(itemId: number): ModuleRecipe | undefined;
|
|
2693
|
+
declare function getComponentById(id: number): ComponentDefinition | undefined;
|
|
2694
|
+
declare function getEntityRecipe(id: string): EntityRecipe | undefined;
|
|
2695
|
+
declare function getEntityRecipeByItemId(itemId: number): EntityRecipe | undefined;
|
|
2696
|
+
declare function getEntitySlotLayout(packedItemId: number): ModuleSlot[];
|
|
2697
|
+
declare function getAllCraftableItems(): CraftableItem[];
|
|
2698
|
+
declare function getComponentsForCategory(category: ResourceCategory): ComponentDefinition[];
|
|
2699
|
+
declare function getComponentsForStat(statKey: string): ComponentDefinition[];
|
|
2700
|
+
|
|
2701
|
+
declare function computeShipHullCapabilities(stats: Record<string, number>): {
|
|
2702
|
+
hullmass: number;
|
|
2703
|
+
capacity: number;
|
|
2704
|
+
};
|
|
2705
|
+
declare function computeEngineCapabilities(stats: Record<string, number>): {
|
|
2706
|
+
thrust: number;
|
|
2707
|
+
drain: number;
|
|
2708
|
+
};
|
|
2709
|
+
declare function computeGeneratorCapabilities(stats: Record<string, number>): {
|
|
2710
|
+
capacity: number;
|
|
2711
|
+
recharge: number;
|
|
2712
|
+
};
|
|
2713
|
+
declare function computeGathererCapabilities(stats: Record<string, number>): {
|
|
2714
|
+
yield: number;
|
|
2715
|
+
drain: number;
|
|
2716
|
+
depth: number;
|
|
2717
|
+
speed: number;
|
|
2718
|
+
};
|
|
2719
|
+
declare function computeLoaderCapabilities(stats: Record<string, number>): {
|
|
2720
|
+
mass: number;
|
|
2721
|
+
thrust: number;
|
|
2722
|
+
quantity: number;
|
|
2723
|
+
};
|
|
2724
|
+
declare function computeCrafterCapabilities(stats: Record<string, number>): {
|
|
2725
|
+
speed: number;
|
|
2726
|
+
drain: number;
|
|
2727
|
+
};
|
|
2728
|
+
declare function computeHaulerCapabilities(stats: Record<string, number>): {
|
|
2729
|
+
capacity: number;
|
|
2730
|
+
efficiency: number;
|
|
2731
|
+
drain: number;
|
|
2732
|
+
};
|
|
2733
|
+
declare function computeStorageCapabilities(stats: Record<string, number>, baseCapacity: number): {
|
|
2734
|
+
capacityBonus: number;
|
|
2735
|
+
};
|
|
2736
|
+
declare function computeWarehouseHullCapabilities(stats: Record<string, number>): {
|
|
2737
|
+
hullmass: number;
|
|
2738
|
+
capacity: number;
|
|
2739
|
+
};
|
|
2740
|
+
interface ShipCapabilities {
|
|
2741
|
+
engines?: {
|
|
2742
|
+
thrust: number;
|
|
2743
|
+
drain: number;
|
|
2744
|
+
};
|
|
2745
|
+
generator?: {
|
|
2746
|
+
capacity: number;
|
|
2747
|
+
recharge: number;
|
|
2748
|
+
};
|
|
2749
|
+
gatherer?: {
|
|
2750
|
+
yield: number;
|
|
2751
|
+
drain: number;
|
|
2752
|
+
depth: number;
|
|
2753
|
+
speed: number;
|
|
2754
|
+
};
|
|
2755
|
+
hauler?: {
|
|
2756
|
+
capacity: number;
|
|
2757
|
+
efficiency: number;
|
|
2758
|
+
drain: number;
|
|
2759
|
+
};
|
|
2760
|
+
loaders?: {
|
|
2761
|
+
mass: number;
|
|
2762
|
+
thrust: number;
|
|
2763
|
+
quantity: number;
|
|
2764
|
+
};
|
|
2765
|
+
crafter?: {
|
|
2766
|
+
speed: number;
|
|
2767
|
+
drain: number;
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
declare function computeShipCapabilities(modules: {
|
|
2771
|
+
itemId: number;
|
|
2772
|
+
stats: bigint;
|
|
2773
|
+
}[]): ShipCapabilities;
|
|
2774
|
+
|
|
2775
|
+
interface ResolvedItemStat {
|
|
2776
|
+
key: string;
|
|
2777
|
+
label: string;
|
|
2778
|
+
abbreviation: string;
|
|
2779
|
+
value: number;
|
|
2780
|
+
color: string;
|
|
2781
|
+
category: ResourceCategory;
|
|
2782
|
+
inverted?: boolean;
|
|
2783
|
+
}
|
|
2784
|
+
interface ResolvedAttributeGroup {
|
|
2785
|
+
capability: string;
|
|
2786
|
+
attributes: {
|
|
2787
|
+
label: string;
|
|
2788
|
+
value: number;
|
|
2789
|
+
}[];
|
|
2790
|
+
}
|
|
2791
|
+
type ResolvedItemType = 'resource' | 'component' | 'module' | 'entity';
|
|
2792
|
+
interface ResolvedModuleSlot {
|
|
2793
|
+
name?: string;
|
|
2794
|
+
installed: boolean;
|
|
2795
|
+
attributes?: {
|
|
2796
|
+
label: string;
|
|
2797
|
+
value: number;
|
|
2798
|
+
}[];
|
|
2799
|
+
}
|
|
2800
|
+
interface ResolvedItem {
|
|
2801
|
+
itemId: number;
|
|
2802
|
+
name: string;
|
|
2803
|
+
icon: string;
|
|
2804
|
+
abbreviation: string | null;
|
|
2805
|
+
category?: ResourceCategory;
|
|
2806
|
+
tier: ResourceTier;
|
|
2807
|
+
mass: number;
|
|
2808
|
+
itemType: ResolvedItemType;
|
|
2809
|
+
stats?: ResolvedItemStat[];
|
|
2810
|
+
attributes?: ResolvedAttributeGroup[];
|
|
2811
|
+
moduleSlots?: ResolvedModuleSlot[];
|
|
2812
|
+
}
|
|
2813
|
+
declare function resolveItem(itemId: UInt16Type, stats?: UInt64Type, modules?: Types.module_entry[]): ResolvedItem;
|
|
2814
|
+
|
|
2815
|
+
interface TextSpan {
|
|
2816
|
+
text: string;
|
|
2817
|
+
highlight?: boolean;
|
|
2818
|
+
}
|
|
2819
|
+
interface CapabilityInput {
|
|
2820
|
+
capability: string;
|
|
2821
|
+
attributes: {
|
|
2822
|
+
label: string;
|
|
2823
|
+
value: number;
|
|
2824
|
+
}[];
|
|
2825
|
+
}
|
|
2826
|
+
interface ModuleDescription {
|
|
2827
|
+
id: string;
|
|
2828
|
+
template: string;
|
|
2829
|
+
params: Readonly<Record<string, number | string>>;
|
|
2830
|
+
highlightKeys: readonly string[];
|
|
2831
|
+
}
|
|
2832
|
+
interface RenderDescriptionOptions {
|
|
2833
|
+
translate?: (id: string, fallback: string) => string;
|
|
2834
|
+
formatNumber?: (n: number) => string;
|
|
2835
|
+
}
|
|
2836
|
+
declare function describeModule(input: CapabilityInput): ModuleDescription | null;
|
|
2837
|
+
declare function describeModuleForItem(resolved: ResolvedItem): ModuleDescription | null;
|
|
2838
|
+
declare function describeModuleForSlot(slot: ResolvedModuleSlot): ModuleDescription | null;
|
|
2839
|
+
declare function renderDescription(desc: ModuleDescription, options?: RenderDescriptionOptions): TextSpan[];
|
|
2840
|
+
|
|
2841
|
+
interface NFTInstalledModule {
|
|
2842
|
+
item_id: number;
|
|
2843
|
+
stats: string;
|
|
2844
|
+
}
|
|
2845
|
+
interface NFTModuleSlot {
|
|
2846
|
+
type: number;
|
|
2847
|
+
installed?: NFTInstalledModule;
|
|
2848
|
+
}
|
|
2849
|
+
interface NFTCargoItem {
|
|
2850
|
+
item_id: number;
|
|
2851
|
+
quantity: number;
|
|
2852
|
+
stats: string;
|
|
2853
|
+
modules?: NFTModuleSlot[];
|
|
2854
|
+
}
|
|
2855
|
+
interface NFTCommonBase {
|
|
2856
|
+
quantity: number;
|
|
2857
|
+
stats: string;
|
|
2858
|
+
origin_x: string;
|
|
2859
|
+
origin_y: string;
|
|
2860
|
+
}
|
|
2861
|
+
declare function readCommonBase(data: Record<string, any>): NFTCommonBase;
|
|
2862
|
+
declare function deserializeScalar(data: Record<string, any>, itemId: number): NFTCargoItem;
|
|
2863
|
+
declare const deserializeResource: typeof deserializeScalar;
|
|
2864
|
+
declare const deserializeComponent: typeof deserializeScalar;
|
|
2865
|
+
declare const deserializeModule: typeof deserializeScalar;
|
|
2866
|
+
declare function deserializeEntity(data: Record<string, any>, itemId: number): NFTCargoItem;
|
|
2867
|
+
declare function deserializeAsset(data: Record<string, any>, itemId: number): NFTCargoItem;
|
|
2868
|
+
|
|
2869
|
+
declare function computeBaseHullmass(stats: bigint): number;
|
|
2870
|
+
declare function computeBaseCapacityShip(stats: bigint): number;
|
|
2871
|
+
declare function computeBaseCapacityWarehouse(stats: bigint): number;
|
|
2872
|
+
declare const computeEngineThrust: (vol: number) => number;
|
|
2873
|
+
declare const computeEngineDrain: (thm: number) => number;
|
|
2874
|
+
declare const computeGeneratorCap: (res: number) => number;
|
|
2875
|
+
declare const computeGeneratorRech: (ref: number) => number;
|
|
2876
|
+
declare const computeGathererYield: (str: number) => number;
|
|
2877
|
+
declare const computeGathererDrain: (con: number) => number;
|
|
2878
|
+
declare const computeGathererDepth: (tol: number) => number;
|
|
2879
|
+
declare const computeGathererSpeed: (ref: number) => number;
|
|
2880
|
+
declare const computeLoaderMass: (fin: number) => number;
|
|
2881
|
+
declare const computeLoaderThrust: (pla: number) => number;
|
|
2882
|
+
declare const computeCrafterSpeed: (rea: number) => number;
|
|
2883
|
+
declare const computeCrafterDrain: (com: number) => number;
|
|
2884
|
+
declare function entityDisplayName(itemId: number): string;
|
|
2885
|
+
declare function moduleDisplayName(itemId: number): string;
|
|
2886
|
+
declare function formatModuleLine(slot: number, itemId: number, stats: bigint): string;
|
|
2887
|
+
declare function buildEntityDescription(itemId: number, hullStats: bigint, moduleItems: number[], moduleStats: bigint[]): string;
|
|
2888
|
+
|
|
2889
|
+
type index_NFTInstalledModule = NFTInstalledModule;
|
|
2890
|
+
type index_NFTModuleSlot = NFTModuleSlot;
|
|
2891
|
+
type index_NFTCargoItem = NFTCargoItem;
|
|
2892
|
+
type index_NFTCommonBase = NFTCommonBase;
|
|
2893
|
+
declare const index_readCommonBase: typeof readCommonBase;
|
|
2894
|
+
declare const index_deserializeScalar: typeof deserializeScalar;
|
|
2895
|
+
declare const index_deserializeResource: typeof deserializeResource;
|
|
2896
|
+
declare const index_deserializeComponent: typeof deserializeComponent;
|
|
2897
|
+
declare const index_deserializeModule: typeof deserializeModule;
|
|
2898
|
+
declare const index_deserializeEntity: typeof deserializeEntity;
|
|
2899
|
+
declare const index_deserializeAsset: typeof deserializeAsset;
|
|
2900
|
+
declare const index_computeBaseHullmass: typeof computeBaseHullmass;
|
|
2901
|
+
declare const index_computeBaseCapacityShip: typeof computeBaseCapacityShip;
|
|
2902
|
+
declare const index_computeBaseCapacityWarehouse: typeof computeBaseCapacityWarehouse;
|
|
2903
|
+
declare const index_computeEngineThrust: typeof computeEngineThrust;
|
|
2904
|
+
declare const index_computeEngineDrain: typeof computeEngineDrain;
|
|
2905
|
+
declare const index_computeGeneratorCap: typeof computeGeneratorCap;
|
|
2906
|
+
declare const index_computeGeneratorRech: typeof computeGeneratorRech;
|
|
2907
|
+
declare const index_computeGathererYield: typeof computeGathererYield;
|
|
2908
|
+
declare const index_computeGathererDrain: typeof computeGathererDrain;
|
|
2909
|
+
declare const index_computeGathererDepth: typeof computeGathererDepth;
|
|
2910
|
+
declare const index_computeGathererSpeed: typeof computeGathererSpeed;
|
|
2911
|
+
declare const index_computeLoaderMass: typeof computeLoaderMass;
|
|
2912
|
+
declare const index_computeLoaderThrust: typeof computeLoaderThrust;
|
|
2913
|
+
declare const index_computeCrafterSpeed: typeof computeCrafterSpeed;
|
|
2914
|
+
declare const index_computeCrafterDrain: typeof computeCrafterDrain;
|
|
2915
|
+
declare const index_entityDisplayName: typeof entityDisplayName;
|
|
2916
|
+
declare const index_moduleDisplayName: typeof moduleDisplayName;
|
|
2917
|
+
declare const index_formatModuleLine: typeof formatModuleLine;
|
|
2918
|
+
declare const index_buildEntityDescription: typeof buildEntityDescription;
|
|
2919
|
+
declare namespace index {
|
|
2920
|
+
export {
|
|
2921
|
+
index_NFTInstalledModule as NFTInstalledModule,
|
|
2922
|
+
index_NFTModuleSlot as NFTModuleSlot,
|
|
2923
|
+
index_NFTCargoItem as NFTCargoItem,
|
|
2924
|
+
index_NFTCommonBase as NFTCommonBase,
|
|
2925
|
+
index_readCommonBase as readCommonBase,
|
|
2926
|
+
index_deserializeScalar as deserializeScalar,
|
|
2927
|
+
index_deserializeResource as deserializeResource,
|
|
2928
|
+
index_deserializeComponent as deserializeComponent,
|
|
2929
|
+
index_deserializeModule as deserializeModule,
|
|
2930
|
+
index_deserializeEntity as deserializeEntity,
|
|
2931
|
+
index_deserializeAsset as deserializeAsset,
|
|
2932
|
+
index_computeBaseHullmass as computeBaseHullmass,
|
|
2933
|
+
index_computeBaseCapacityShip as computeBaseCapacityShip,
|
|
2934
|
+
index_computeBaseCapacityWarehouse as computeBaseCapacityWarehouse,
|
|
2935
|
+
index_computeEngineThrust as computeEngineThrust,
|
|
2936
|
+
index_computeEngineDrain as computeEngineDrain,
|
|
2937
|
+
index_computeGeneratorCap as computeGeneratorCap,
|
|
2938
|
+
index_computeGeneratorRech as computeGeneratorRech,
|
|
2939
|
+
index_computeGathererYield as computeGathererYield,
|
|
2940
|
+
index_computeGathererDrain as computeGathererDrain,
|
|
2941
|
+
index_computeGathererDepth as computeGathererDepth,
|
|
2942
|
+
index_computeGathererSpeed as computeGathererSpeed,
|
|
2943
|
+
index_computeLoaderMass as computeLoaderMass,
|
|
2944
|
+
index_computeLoaderThrust as computeLoaderThrust,
|
|
2945
|
+
index_computeCrafterSpeed as computeCrafterSpeed,
|
|
2946
|
+
index_computeCrafterDrain as computeCrafterDrain,
|
|
2947
|
+
index_entityDisplayName as entityDisplayName,
|
|
2948
|
+
index_moduleDisplayName as moduleDisplayName,
|
|
2949
|
+
index_formatModuleLine as formatModuleLine,
|
|
2950
|
+
index_buildEntityDescription as buildEntityDescription,
|
|
2951
|
+
};
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
declare function formatMass(kg: number): string;
|
|
2955
|
+
declare function formatMassDelta(kg: number): string;
|
|
2956
|
+
|
|
2957
|
+
interface DisplayNameInput {
|
|
2958
|
+
itemType: 'resource' | 'component' | 'module' | 'entity' | string;
|
|
2959
|
+
tier: ResourceTier | string;
|
|
2960
|
+
category?: ResourceCategory;
|
|
2961
|
+
name: string;
|
|
2962
|
+
}
|
|
2963
|
+
declare function displayName(resolved: DisplayNameInput): string;
|
|
2964
|
+
interface DescribeOptions {
|
|
2965
|
+
translate?: (key: string) => string;
|
|
2966
|
+
formatNumber?: (n: number) => string;
|
|
2967
|
+
formatMass?: (kg: number) => string;
|
|
2968
|
+
}
|
|
2969
|
+
declare function describeItem(resolved: ResolvedItem, opts?: DescribeOptions): string;
|
|
2970
|
+
|
|
2971
|
+
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
2972
|
+
interface WebSocketConnectionOptions {
|
|
2973
|
+
url: string;
|
|
2974
|
+
onMessage: (message: ServerMessage) => void;
|
|
2975
|
+
onStateChange?: (state: ConnectionState) => void;
|
|
2976
|
+
}
|
|
2977
|
+
declare class WebSocketConnection {
|
|
2978
|
+
private ws;
|
|
2979
|
+
private url;
|
|
2980
|
+
private onMessage;
|
|
2981
|
+
private onStateChange?;
|
|
2982
|
+
private reconnectAttempts;
|
|
2983
|
+
private reconnectTimeout;
|
|
2984
|
+
private _state;
|
|
2985
|
+
private shouldReconnect;
|
|
2986
|
+
private sendQueue;
|
|
2987
|
+
private static readonly MIN_RECONNECT_DELAY;
|
|
2988
|
+
private static readonly MAX_RECONNECT_DELAY;
|
|
2989
|
+
private static readonly RECONNECT_MULTIPLIER;
|
|
2990
|
+
constructor(options: WebSocketConnectionOptions);
|
|
2991
|
+
get state(): ConnectionState;
|
|
2992
|
+
private setState;
|
|
2993
|
+
connect(): void;
|
|
2994
|
+
private scheduleReconnect;
|
|
2995
|
+
disconnect(): void;
|
|
2996
|
+
close(): void;
|
|
2997
|
+
send(message: ClientMessage): void;
|
|
2998
|
+
get isConnected(): boolean;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
declare function mapEntity(ei: Types.entity_info): Ship | Warehouse | Container;
|
|
3002
|
+
declare function parseWireEntity(raw: WireEntity): Types.entity_info;
|
|
3003
|
+
|
|
3004
|
+
declare function setSubscriptionsDebug(on: boolean): void;
|
|
3005
|
+
declare function isSubscriptionsDebugEnabled(): boolean;
|
|
2472
3006
|
|
|
2473
3007
|
type movement_stats = Types.movement_stats;
|
|
2474
3008
|
type energy_stats = Types.energy_stats;
|
|
@@ -2477,12 +3011,10 @@ type task = Types.task;
|
|
|
2477
3011
|
type cargo_item = Types.cargo_item;
|
|
2478
3012
|
type warehouse_row = Types.warehouse_row;
|
|
2479
3013
|
type container_row = Types.container_row;
|
|
2480
|
-
type
|
|
2481
|
-
type mixture_info = Types.mixture_info;
|
|
2482
|
-
type mixture_component = Types.mixture_component;
|
|
3014
|
+
type gatherer_stats = Types.gatherer_stats;
|
|
2483
3015
|
type location_static = Types.location_static;
|
|
2484
3016
|
type location_epoch = Types.location_epoch;
|
|
2485
3017
|
type location_derived = Types.location_derived;
|
|
2486
3018
|
type location_row = Types.location_row;
|
|
2487
3019
|
|
|
2488
|
-
export { ActionsManager, AnyEntity,
|
|
3020
|
+
export { AckMessage, ActionsManager, AnyEntity, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_CAPACITY_EXCEEDED, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ComponentDefinition, ComponentStat, ConnectionState, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DescribeOptions, Distance, ENTITY_CAPACITY_EXCEEDED, ENTITY_NO_CRAFTER, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInfo, EntityInstance, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntitySubscriptionHandle, EntityType, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_DOES_NOT_EXIST, ITEM_ENGINE_T1, ITEM_FOCUSING_ARRAY, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MATTER_CONDUIT, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_SURVEY_PROBE, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, ModuleDescription, ModuleEntry, ModuleRecipe, ModuleSlot, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, RecipeInput, RecipeSlotInput, RenderDescriptionOptions, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CAPACITY_EXCEEDED, 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, STARTER_ALREADY_CLAIMED, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, ServerMessage, Ship, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, SnapshotMessage, StackInput, StatDefinition, StatMapping, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ADJECTIVES, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WarehouseStateInput, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryIconShapes, categoryIcons, categoryItemMass, componentIcon, components, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererSpeed, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, encodeGatheredCargoStats, encodeStats, energyPercent, energy_stats, entityDisplayName, entityRecipes, estimateDealTravelTime, estimateTravelTime, findNearbyPlanets, formatMass, formatMassDelta, formatModuleLine, gatherer_stats, getAllCraftableItems, getCapabilityAttributes, getCategoryInfo, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEntitySlotLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getLocationTypeName, getModuleCapabilityType, getModuleRecipe, getModuleRecipeByItemId, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isModuleItem, isRelatedItem, isSubscriptionsDebugEnabled, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleRecipes, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, tierLabels, tierNumber, toLocation, validateSchedule, warehouse_row };
|