@shipload/sdk 2.0.0-rc1 → 2.0.0-rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +349 -1
  2. package/lib/shipload.d.ts +809 -314
  3. package/lib/shipload.js +2745 -1740
  4. package/lib/shipload.js.map +1 -1
  5. package/lib/shipload.m.js +2158 -1154
  6. package/lib/shipload.m.js.map +1 -1
  7. package/package.json +1 -2
  8. package/src/capabilities/extraction.ts +30 -0
  9. package/src/capabilities/guards.ts +43 -0
  10. package/src/capabilities/index.ts +5 -0
  11. package/src/capabilities/loading.ts +8 -0
  12. package/src/capabilities/movement.ts +29 -0
  13. package/src/capabilities/storage.ts +67 -0
  14. package/src/contracts/server.ts +506 -183
  15. package/src/data/items.json +16 -0
  16. package/src/derivation/index.ts +25 -0
  17. package/src/derivation/location-size.ts +15 -0
  18. package/src/derivation/resources.ts +141 -0
  19. package/src/derivation/stratum.ts +116 -0
  20. package/src/entities/cargo-utils.ts +98 -3
  21. package/src/entities/container.ts +70 -0
  22. package/src/entities/entity-inventory.ts +13 -9
  23. package/src/entities/inventory-accessor.ts +46 -0
  24. package/src/entities/location.ts +31 -17
  25. package/src/entities/makers.ts +69 -0
  26. package/src/entities/player.ts +2 -1
  27. package/src/entities/ship.ts +93 -440
  28. package/src/entities/warehouse.ts +29 -145
  29. package/src/errors.ts +4 -4
  30. package/src/index-module.ts +62 -4
  31. package/src/managers/actions.ts +75 -31
  32. package/src/managers/entities.ts +22 -5
  33. package/src/managers/locations.ts +34 -15
  34. package/src/managers/trades.ts +7 -7
  35. package/src/market/items.ts +31 -0
  36. package/src/market/market.ts +12 -13
  37. package/src/scheduling/accessor.ts +82 -0
  38. package/src/scheduling/projection.ts +126 -54
  39. package/src/scheduling/schedule.ts +24 -0
  40. package/src/trading/collect.ts +25 -26
  41. package/src/trading/deal.ts +8 -9
  42. package/src/trading/trade.ts +9 -9
  43. package/src/travel/travel.ts +69 -8
  44. package/src/types/capabilities.ts +79 -0
  45. package/src/types/entity-traits.ts +70 -0
  46. package/src/types/entity.ts +36 -0
  47. package/src/types/index.ts +3 -0
  48. package/src/types.ts +92 -15
  49. package/src/utils/hash.ts +1 -1
  50. package/src/utils/system.ts +97 -4
  51. package/src/data/goods.json +0 -23
  52. package/src/market/goods.ts +0 -31
package/lib/shipload.m.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from 'tslib';
2
- import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, UInt16, Int64, UInt8, TimePoint, Bytes, Checksum512, APIClient } from '@wharfkit/antelope';
2
+ import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, UInt16, UInt8, TimePoint, Int64, Bytes, Checksum512, APIClient } from '@wharfkit/antelope';
3
3
  import ContractKit, { Contract as Contract$2 } from '@wharfkit/contract';
4
4
 
5
5
  const abiBlob$1 = Blob.from('DmVvc2lvOjphYmkvMS4yAA0KY2xlYXJ0YWJsZQADCnRhYmxlX25hbWUEbmFtZQVzY29wZQVuYW1lPwhtYXhfcm93cwd1aW50NjQ/C2NvbXBhbnlfcm93AAIHYWNjb3VudARuYW1lBG5hbWUGc3RyaW5nBmVuYWJsZQABB2VuYWJsZWQEYm9vbAplbmFibGVnYW1lAAIIY29udHJhY3QEbmFtZQdlbmFibGVkBGJvb2wMZm91bmRjb21wYW55AAIHYWNjb3VudARuYW1lBG5hbWUGc3RyaW5nC2dhbWVfY29uZmlnAAQEc2VlZAtjaGVja3N1bTI1NgllcG9jaHRpbWUGdWludDMyBXN0YXJ0DnRpbWVfcG9pbnRfc2VjA2VuZA50aW1lX3BvaW50X3NlYwlnYW1lX21ldGEABARuYW1lBnN0cmluZwtkZXNjcmlwdGlvbgZzdHJpbmcDdXJsBnN0cmluZwd2ZXJzaW9uBnN0cmluZwhnYW1lX3JvdwAECGNvbnRyYWN0BG5hbWUGY29uZmlnC2dhbWVfY29uZmlnBG1ldGEJ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BkYXRlIGdhbWUgaW5mb3JtYXRpb24nCmljb246IGh0dHBzOi8vYXZhdGFycy5naXRodWJ1c2VyY29udGVudC5jb20vdS8xNTgxMTM3ODIjZDNiZjI5MGZkZGVkZGJiN2QzMmFhODk3ZTlmN2U5ZTEzYTJhZTQ0OTU2MTQyZTIzZWI0N2I3NzA5NmEyZWE4ZAoKLS0tCgpVcGRhdGUgdGhlIGluZm9ybWF0aW9uIGFib3V0IHRoZSBzcGVjaWZpZWQgZ2FtZSBjb250cmFjdC4KCi0tLQAAAAAAoKrjBHdpcGWyAS0tLQoKc3BlY192ZXJzaW9uOiAiMC4yLjAiCnRpdGxlOiB3aXBlCnN1bW1hcnk6ICdERUJVRzogd2lwZSBhY3Rpb24nCmljb246IGh0dHBzOi8vYXZhdGFycy5naXRodWJ1c2VyY29udGVudC5jb20vdS8xNDcyOTI4NjE/cz00MDAmdT0zYjFhZjY2ZTkwZGQ4NTFmNGQ3YzA5NmVkNmEyZmJiNGI5ZTE5MGRhCgotLS0DAAAAwE9TJUUDaTY0AAALY29tcGFueV9yb3cAAAAAAKykYQNpNjQAAAhnYW1lX3JvdwAAAAAAlU3GA2k2NAAACXN0YXRlX3JvdwETU2hpcGxvYWQgKFBsYXRmb3JtKRNTaGlwbG9hZCAoUGxhdGZvcm0pAAAAAA==');
@@ -205,7 +205,7 @@ var platform = /*#__PURE__*/Object.freeze({
205
205
  Contract: Contract$1
206
206
  });
207
207
 
208
- const abiBlob = Blob.from('DmVvc2lvOjphYmkvMS4yAEEHYWR2YW5jZQACBnJldmVhbAZzdHJpbmcGY29tbWl0C2NoZWNrc3VtMjU2CGJ1eWdvb2RzAAMHc2hpcF9pZAZ1aW50NjQHZ29vZF9pZAZ1aW50MTYIcXVhbnRpdHkGdWludDMyB2J1eXNoaXAAAgdhY2NvdW50BG5hbWUEbmFtZQZzdHJpbmcMYnV5d2FyZWhvdXNlAAMHYWNjb3VudARuYW1lB3NoaXBfaWQGdWludDY0BG5hbWUGc3RyaW5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NrANpNjQAAApwbGF5ZXJfcm93AAAAQO2rsLoDaTY0AAALcmVzZXJ2ZV9yb3cAAAAKTaWtwgNpNjQAAAxzZXF1ZW5jZV9yb3cAAAAAAFBdwwNpNjQAAAhzaGlwX3JvdwAAAAAAlU3GA2k2NAAACXN0YXRlX3JvdwAAAAD4WKvGA2k2NAAACnN1cHBseV9yb3cAAAAAAKyqzwNpNjQAAAl0eXBlc19yb3cAAFBY06au4QNpNjQAAA13YXJlaG91c2Vfcm93ARFTaGlwbG9hZCAoU2VydmVyKRFTaGlwbG9hZCAoU2VydmVyKQAAABUAAABYquy8Pgx0YXNrX3Jlc3VsdHMAAAAARIWmQQ5jYW5jZWxfcmVzdWx0cwAAACAjc3NXDHRhc2tfcmVzdWx0cwAAYG5NirJiC2dhbWVfY29uZmlnALBy2eWpsmINZW50aXR5X2luZm9bXQAA8NnlqbJiC2VudGl0eV9pbmZvAAAAWKrssmIKaXRlbXNfaW5mbwAmddkgGrNiDWxvY2F0aW9uX2luZm8AgMkmIRqzYhBsb2NhdGlvbl9kZXJpdmVkAADw5xo1s2ILbmVhcmJ5X2luZm8AALjKm1izYgtwbGF5ZXJfaW5mbwDAVfmajLNiDHN0YXJ0ZXJfaW5mb4CVu0ZKjbNiEGVudGl0eV9zdW1tYXJ5W10Aotrm5qrpZQx0YXNrX3Jlc3VsdHMAAAAAANCwaQtjaGVja3N1bTI1NgAAAECE0rBpC2NoZWNrc3VtNTEyAAAAil3TkLoMdGFza19yZXN1bHRzAAAAQO1IsboPcmVzb2x2ZV9yZXN1bHRzAADAUmUXo8IMdGFza19yZXN1bHRzAAAAVy08zc0MdGFza19yZXN1bHRzAAAAAES1zc0MdGFza19yZXN1bHRz');
209
209
  const abi = ABI.from(abiBlob);
210
210
  var Types;
211
211
  (function (Types) {
@@ -221,21 +221,39 @@ var Types;
221
221
  Struct.type('advance')
222
222
  ], advance);
223
223
  Types.advance = advance;
224
- let buygoods = class buygoods extends Struct {
224
+ let buycontainer = class buycontainer extends Struct {
225
225
  };
226
+ __decorate([
227
+ Struct.field(Name)
228
+ ], buycontainer.prototype, "account", void 0);
229
+ __decorate([
230
+ Struct.field(UInt64)
231
+ ], buycontainer.prototype, "ship_id", void 0);
232
+ __decorate([
233
+ Struct.field('string')
234
+ ], buycontainer.prototype, "name", void 0);
235
+ buycontainer = __decorate([
236
+ Struct.type('buycontainer')
237
+ ], buycontainer);
238
+ Types.buycontainer = buycontainer;
239
+ let buyitems = class buyitems extends Struct {
240
+ };
241
+ __decorate([
242
+ Struct.field(Name)
243
+ ], buyitems.prototype, "entity_type", void 0);
226
244
  __decorate([
227
245
  Struct.field(UInt64)
228
- ], buygoods.prototype, "ship_id", void 0);
246
+ ], buyitems.prototype, "id", void 0);
229
247
  __decorate([
230
248
  Struct.field(UInt16)
231
- ], buygoods.prototype, "good_id", void 0);
249
+ ], buyitems.prototype, "item_id", void 0);
232
250
  __decorate([
233
251
  Struct.field(UInt32)
234
- ], buygoods.prototype, "quantity", void 0);
235
- buygoods = __decorate([
236
- Struct.type('buygoods')
237
- ], buygoods);
238
- Types.buygoods = buygoods;
252
+ ], buyitems.prototype, "quantity", void 0);
253
+ buyitems = __decorate([
254
+ Struct.type('buyitems')
255
+ ], buyitems);
256
+ Types.buyitems = buyitems;
239
257
  let buyship = class buyship extends Struct {
240
258
  };
241
259
  __decorate([
@@ -278,87 +296,18 @@ var Types;
278
296
  Struct.type('cancel')
279
297
  ], cancel);
280
298
  Types.cancel = cancel;
281
- let coordinates = class coordinates extends Struct {
282
- };
283
- __decorate([
284
- Struct.field(Int64)
285
- ], coordinates.prototype, "x", void 0);
286
- __decorate([
287
- Struct.field(Int64)
288
- ], coordinates.prototype, "y", void 0);
289
- __decorate([
290
- Struct.field(UInt16, { optional: true })
291
- ], coordinates.prototype, "z", void 0);
292
- coordinates = __decorate([
293
- Struct.type('coordinates')
294
- ], coordinates);
295
- Types.coordinates = coordinates;
296
- let cargo_item = class cargo_item extends Struct {
297
- };
298
- __decorate([
299
- Struct.field(UInt16)
300
- ], cargo_item.prototype, "good_id", void 0);
301
- __decorate([
302
- Struct.field(UInt32)
303
- ], cargo_item.prototype, "quantity", void 0);
304
- __decorate([
305
- Struct.field(UInt64)
306
- ], cargo_item.prototype, "unit_cost", void 0);
307
- cargo_item = __decorate([
308
- Struct.type('cargo_item')
309
- ], cargo_item);
310
- Types.cargo_item = cargo_item;
311
- let task = class task extends Struct {
312
- };
313
- __decorate([
314
- Struct.field(UInt8)
315
- ], task.prototype, "type", void 0);
316
- __decorate([
317
- Struct.field(UInt32)
318
- ], task.prototype, "duration", void 0);
319
- __decorate([
320
- Struct.field(UInt8)
321
- ], task.prototype, "cancelable", void 0);
322
- __decorate([
323
- Struct.field(coordinates, { optional: true })
324
- ], task.prototype, "location", void 0);
325
- __decorate([
326
- Struct.field(cargo_item, { array: true })
327
- ], task.prototype, "cargo", void 0);
328
- __decorate([
329
- Struct.field(UInt64, { optional: true })
330
- ], task.prototype, "entity", void 0);
331
- __decorate([
332
- Struct.field(Int64, { optional: true })
333
- ], task.prototype, "credits", void 0);
334
- task = __decorate([
335
- Struct.type('task')
336
- ], task);
337
- Types.task = task;
338
- let cancel_log = class cancel_log extends Struct {
299
+ let entity_ref = class entity_ref extends Struct {
339
300
  };
340
301
  __decorate([
341
302
  Struct.field(Name)
342
- ], cancel_log.prototype, "owner", void 0);
343
- __decorate([
344
- Struct.field(Name)
345
- ], cancel_log.prototype, "entity_type", void 0);
303
+ ], entity_ref.prototype, "entity_type", void 0);
346
304
  __decorate([
347
305
  Struct.field(UInt64)
348
- ], cancel_log.prototype, "entity_id", void 0);
349
- __decorate([
350
- Struct.field(UInt8)
351
- ], cancel_log.prototype, "task_index", void 0);
352
- __decorate([
353
- Struct.field(task)
354
- ], cancel_log.prototype, "task", void 0);
355
- __decorate([
356
- Struct.field(TimePoint)
357
- ], cancel_log.prototype, "started_at", void 0);
358
- cancel_log = __decorate([
359
- Struct.type('cancel_log')
360
- ], cancel_log);
361
- Types.cancel_log = cancel_log;
306
+ ], entity_ref.prototype, "entity_id", void 0);
307
+ entity_ref = __decorate([
308
+ Struct.type('entity_ref')
309
+ ], entity_ref);
310
+ Types.entity_ref = entity_ref;
362
311
  let cancel_results = class cancel_results extends Struct {
363
312
  };
364
313
  __decorate([
@@ -373,10 +322,34 @@ var Types;
373
322
  __decorate([
374
323
  Struct.field(TimePoint, { optional: true })
375
324
  ], cancel_results.prototype, "schedule_started", void 0);
325
+ __decorate([
326
+ Struct.field(UInt64, { optional: true })
327
+ ], cancel_results.prototype, "entitygroup", void 0);
328
+ __decorate([
329
+ Struct.field(entity_ref, { array: true, optional: true })
330
+ ], cancel_results.prototype, "group_members", void 0);
376
331
  cancel_results = __decorate([
377
332
  Struct.type('cancel_results')
378
333
  ], cancel_results);
379
334
  Types.cancel_results = cancel_results;
335
+ let cargo_item = class cargo_item extends Struct {
336
+ };
337
+ __decorate([
338
+ Struct.field(UInt16)
339
+ ], cargo_item.prototype, "item_id", void 0);
340
+ __decorate([
341
+ Struct.field(UInt32)
342
+ ], cargo_item.prototype, "quantity", void 0);
343
+ __decorate([
344
+ Struct.field(UInt64)
345
+ ], cargo_item.prototype, "unit_cost", void 0);
346
+ __decorate([
347
+ Struct.field(UInt64, { optional: true })
348
+ ], cargo_item.prototype, "seed", void 0);
349
+ cargo_item = __decorate([
350
+ Struct.type('cargo_item')
351
+ ], cargo_item);
352
+ Types.cargo_item = cargo_item;
380
353
  let cargo_row = class cargo_row extends Struct {
381
354
  };
382
355
  __decorate([
@@ -387,17 +360,32 @@ var Types;
387
360
  ], cargo_row.prototype, "entity_id", void 0);
388
361
  __decorate([
389
362
  Struct.field(UInt64)
390
- ], cargo_row.prototype, "good_id", void 0);
363
+ ], cargo_row.prototype, "item_id", void 0);
391
364
  __decorate([
392
365
  Struct.field(UInt64)
393
366
  ], cargo_row.prototype, "quantity", void 0);
394
367
  __decorate([
395
368
  Struct.field(UInt64)
396
369
  ], cargo_row.prototype, "unit_cost", void 0);
370
+ __decorate([
371
+ Struct.field(UInt64)
372
+ ], cargo_row.prototype, "seed", void 0);
397
373
  cargo_row = __decorate([
398
374
  Struct.type('cargo_row')
399
375
  ], cargo_row);
400
376
  Types.cargo_row = cargo_row;
377
+ let cleanrsvp = class cleanrsvp extends Struct {
378
+ };
379
+ __decorate([
380
+ Struct.field(UInt64)
381
+ ], cleanrsvp.prototype, "epoch", void 0);
382
+ __decorate([
383
+ Struct.field(UInt64)
384
+ ], cleanrsvp.prototype, "max_rows", void 0);
385
+ cleanrsvp = __decorate([
386
+ Struct.type('cleanrsvp')
387
+ ], cleanrsvp);
388
+ Types.cleanrsvp = cleanrsvp;
401
389
  let cleartable = class cleartable extends Struct {
402
390
  };
403
391
  __decorate([
@@ -422,15 +410,18 @@ var Types;
422
410
  Struct.type('commit')
423
411
  ], commit);
424
412
  Types.commit = commit;
425
- let enable = class enable extends Struct {
413
+ let movement_stats = class movement_stats extends Struct {
426
414
  };
427
415
  __decorate([
428
- Struct.field('bool')
429
- ], enable.prototype, "enabled", void 0);
430
- enable = __decorate([
431
- Struct.type('enable')
432
- ], enable);
433
- Types.enable = enable;
416
+ Struct.field(UInt32)
417
+ ], movement_stats.prototype, "thrust", void 0);
418
+ __decorate([
419
+ Struct.field(UInt16)
420
+ ], movement_stats.prototype, "drain", void 0);
421
+ movement_stats = __decorate([
422
+ Struct.type('movement_stats')
423
+ ], movement_stats);
424
+ Types.movement_stats = movement_stats;
434
425
  let energy_stats = class energy_stats extends Struct {
435
426
  };
436
427
  __decorate([
@@ -458,18 +449,183 @@ var Types;
458
449
  Struct.type('loader_stats')
459
450
  ], loader_stats);
460
451
  Types.loader_stats = loader_stats;
461
- let movement_stats = class movement_stats extends Struct {
452
+ let trade_stats = class trade_stats extends Struct {
453
+ };
454
+ __decorate([
455
+ Struct.field(UInt16)
456
+ ], trade_stats.prototype, "margin", void 0);
457
+ trade_stats = __decorate([
458
+ Struct.type('trade_stats')
459
+ ], trade_stats);
460
+ Types.trade_stats = trade_stats;
461
+ let extractor_stats = class extractor_stats extends Struct {
462
+ };
463
+ __decorate([
464
+ Struct.field(UInt16)
465
+ ], extractor_stats.prototype, "rate", void 0);
466
+ __decorate([
467
+ Struct.field(UInt16)
468
+ ], extractor_stats.prototype, "drain", void 0);
469
+ __decorate([
470
+ Struct.field(UInt16)
471
+ ], extractor_stats.prototype, "efficiency", void 0);
472
+ __decorate([
473
+ Struct.field(UInt16)
474
+ ], extractor_stats.prototype, "depth", void 0);
475
+ __decorate([
476
+ Struct.field(UInt16)
477
+ ], extractor_stats.prototype, "drill", void 0);
478
+ extractor_stats = __decorate([
479
+ Struct.type('extractor_stats')
480
+ ], extractor_stats);
481
+ Types.extractor_stats = extractor_stats;
482
+ let warp_stats = class warp_stats extends Struct {
462
483
  };
463
484
  __decorate([
464
485
  Struct.field(UInt32)
465
- ], movement_stats.prototype, "thrust", void 0);
486
+ ], warp_stats.prototype, "range", void 0);
487
+ warp_stats = __decorate([
488
+ Struct.type('warp_stats')
489
+ ], warp_stats);
490
+ Types.warp_stats = warp_stats;
491
+ let entity_defaults = class entity_defaults extends Struct {
492
+ };
493
+ __decorate([
494
+ Struct.field(UInt32)
495
+ ], entity_defaults.prototype, "ship_hullmass", void 0);
496
+ __decorate([
497
+ Struct.field(UInt32)
498
+ ], entity_defaults.prototype, "ship_capacity", void 0);
466
499
  __decorate([
467
500
  Struct.field(UInt16)
468
- ], movement_stats.prototype, "drain", void 0);
469
- movement_stats = __decorate([
470
- Struct.type('movement_stats')
471
- ], movement_stats);
472
- Types.movement_stats = movement_stats;
501
+ ], entity_defaults.prototype, "ship_energy", void 0);
502
+ __decorate([
503
+ Struct.field(UInt16)
504
+ ], entity_defaults.prototype, "ship_z", void 0);
505
+ __decorate([
506
+ Struct.field(movement_stats)
507
+ ], entity_defaults.prototype, "ship_engines", void 0);
508
+ __decorate([
509
+ Struct.field(energy_stats)
510
+ ], entity_defaults.prototype, "ship_generator", void 0);
511
+ __decorate([
512
+ Struct.field(loader_stats)
513
+ ], entity_defaults.prototype, "ship_loaders", void 0);
514
+ __decorate([
515
+ Struct.field(trade_stats)
516
+ ], entity_defaults.prototype, "ship_trade", void 0);
517
+ __decorate([
518
+ Struct.field(extractor_stats)
519
+ ], entity_defaults.prototype, "ship_extractor", void 0);
520
+ __decorate([
521
+ Struct.field(UInt32)
522
+ ], entity_defaults.prototype, "warehouse_capacity", void 0);
523
+ __decorate([
524
+ Struct.field(UInt16)
525
+ ], entity_defaults.prototype, "warehouse_z", void 0);
526
+ __decorate([
527
+ Struct.field(loader_stats)
528
+ ], entity_defaults.prototype, "warehouse_loaders", void 0);
529
+ __decorate([
530
+ Struct.field(UInt32)
531
+ ], entity_defaults.prototype, "container_hullmass", void 0);
532
+ __decorate([
533
+ Struct.field(UInt32)
534
+ ], entity_defaults.prototype, "container_capacity", void 0);
535
+ __decorate([
536
+ Struct.field(UInt16)
537
+ ], entity_defaults.prototype, "container_z", void 0);
538
+ entity_defaults = __decorate([
539
+ Struct.type('entity_defaults')
540
+ ], entity_defaults);
541
+ Types.entity_defaults = entity_defaults;
542
+ let item_def = class item_def extends Struct {
543
+ };
544
+ __decorate([
545
+ Struct.field(UInt16)
546
+ ], item_def.prototype, "id", void 0);
547
+ __decorate([
548
+ Struct.field(UInt32)
549
+ ], item_def.prototype, "base_price", void 0);
550
+ __decorate([
551
+ Struct.field(UInt32)
552
+ ], item_def.prototype, "mass", void 0);
553
+ item_def = __decorate([
554
+ Struct.type('item_def')
555
+ ], item_def);
556
+ Types.item_def = item_def;
557
+ let game_config = class game_config extends Struct {
558
+ };
559
+ __decorate([
560
+ Struct.field(UInt32)
561
+ ], game_config.prototype, "version", void 0);
562
+ __decorate([
563
+ Struct.field(entity_defaults)
564
+ ], game_config.prototype, "defaults", void 0);
565
+ __decorate([
566
+ Struct.field(item_def, { array: true })
567
+ ], game_config.prototype, "items", void 0);
568
+ game_config = __decorate([
569
+ Struct.type('game_config')
570
+ ], game_config);
571
+ Types.game_config = game_config;
572
+ let configlog = class configlog extends Struct {
573
+ };
574
+ __decorate([
575
+ Struct.field(game_config)
576
+ ], configlog.prototype, "config", void 0);
577
+ configlog = __decorate([
578
+ Struct.type('configlog')
579
+ ], configlog);
580
+ Types.configlog = configlog;
581
+ let coordinates = class coordinates extends Struct {
582
+ };
583
+ __decorate([
584
+ Struct.field(Int64)
585
+ ], coordinates.prototype, "x", void 0);
586
+ __decorate([
587
+ Struct.field(Int64)
588
+ ], coordinates.prototype, "y", void 0);
589
+ __decorate([
590
+ Struct.field(UInt16, { optional: true })
591
+ ], coordinates.prototype, "z", void 0);
592
+ coordinates = __decorate([
593
+ Struct.type('coordinates')
594
+ ], coordinates);
595
+ Types.coordinates = coordinates;
596
+ let task = class task extends Struct {
597
+ };
598
+ __decorate([
599
+ Struct.field(UInt8)
600
+ ], task.prototype, "type", void 0);
601
+ __decorate([
602
+ Struct.field(UInt32)
603
+ ], task.prototype, "duration", void 0);
604
+ __decorate([
605
+ Struct.field(UInt8)
606
+ ], task.prototype, "cancelable", void 0);
607
+ __decorate([
608
+ Struct.field(coordinates, { optional: true })
609
+ ], task.prototype, "coordinates", void 0);
610
+ __decorate([
611
+ Struct.field(cargo_item, { array: true })
612
+ ], task.prototype, "cargo", void 0);
613
+ __decorate([
614
+ Struct.field(entity_ref, { optional: true })
615
+ ], task.prototype, "entitytarget", void 0);
616
+ __decorate([
617
+ Struct.field(UInt64, { optional: true })
618
+ ], task.prototype, "entitygroup", void 0);
619
+ __decorate([
620
+ Struct.field(Int64, { optional: true })
621
+ ], task.prototype, "credits", void 0);
622
+ __decorate([
623
+ Struct.field(UInt16, { optional: true })
624
+ ], task.prototype, "energy_cost", void 0);
625
+ task = __decorate([
626
+ Struct.type('task')
627
+ ], task);
628
+ Types.task = task;
473
629
  let schedule = class schedule extends Struct {
474
630
  };
475
631
  __decorate([
@@ -482,6 +638,57 @@ var Types;
482
638
  Struct.type('schedule')
483
639
  ], schedule);
484
640
  Types.schedule = schedule;
641
+ let container_row = class container_row extends Struct {
642
+ };
643
+ __decorate([
644
+ Struct.field(UInt64)
645
+ ], container_row.prototype, "id", void 0);
646
+ __decorate([
647
+ Struct.field(Name)
648
+ ], container_row.prototype, "owner", void 0);
649
+ __decorate([
650
+ Struct.field('string')
651
+ ], container_row.prototype, "name", void 0);
652
+ __decorate([
653
+ Struct.field(coordinates)
654
+ ], container_row.prototype, "coordinates", void 0);
655
+ __decorate([
656
+ Struct.field(UInt32)
657
+ ], container_row.prototype, "hullmass", void 0);
658
+ __decorate([
659
+ Struct.field(UInt32)
660
+ ], container_row.prototype, "capacity", void 0);
661
+ __decorate([
662
+ Struct.field(UInt32)
663
+ ], container_row.prototype, "cargomass", void 0);
664
+ __decorate([
665
+ Struct.field(schedule, { optional: true })
666
+ ], container_row.prototype, "schedule", void 0);
667
+ container_row = __decorate([
668
+ Struct.type('container_row')
669
+ ], container_row);
670
+ Types.container_row = container_row;
671
+ let enable = class enable extends Struct {
672
+ };
673
+ __decorate([
674
+ Struct.field('bool')
675
+ ], enable.prototype, "enabled", void 0);
676
+ enable = __decorate([
677
+ Struct.type('enable')
678
+ ], enable);
679
+ Types.enable = enable;
680
+ let entity_current_state = class entity_current_state extends Struct {
681
+ };
682
+ __decorate([
683
+ Struct.field(coordinates)
684
+ ], entity_current_state.prototype, "coordinates", void 0);
685
+ __decorate([
686
+ Struct.field(UInt16)
687
+ ], entity_current_state.prototype, "energy", void 0);
688
+ entity_current_state = __decorate([
689
+ Struct.type('entity_current_state')
690
+ ], entity_current_state);
691
+ Types.entity_current_state = entity_current_state;
485
692
  let entity_info = class entity_info extends Struct {
486
693
  };
487
694
  __decorate([
@@ -498,7 +705,7 @@ var Types;
498
705
  ], entity_info.prototype, "entity_name", void 0);
499
706
  __decorate([
500
707
  Struct.field(coordinates)
501
- ], entity_info.prototype, "location", void 0);
708
+ ], entity_info.prototype, "coordinates", void 0);
502
709
  __decorate([
503
710
  Struct.field(UInt32)
504
711
  ], entity_info.prototype, "cargomass", void 0);
@@ -513,7 +720,7 @@ var Types;
513
720
  ], entity_info.prototype, "energy", void 0);
514
721
  __decorate([
515
722
  Struct.field(UInt32, { optional: true })
516
- ], entity_info.prototype, "mass", void 0);
723
+ ], entity_info.prototype, "hullmass", void 0);
517
724
  __decorate([
518
725
  Struct.field(movement_stats, { optional: true })
519
726
  ], entity_info.prototype, "engines", void 0);
@@ -523,6 +730,12 @@ var Types;
523
730
  __decorate([
524
731
  Struct.field(UInt32, { optional: true })
525
732
  ], entity_info.prototype, "capacity", void 0);
733
+ __decorate([
734
+ Struct.field(extractor_stats, { optional: true })
735
+ ], entity_info.prototype, "extractor", void 0);
736
+ __decorate([
737
+ Struct.field(warp_stats, { optional: true })
738
+ ], entity_info.prototype, "warp", void 0);
526
739
  __decorate([
527
740
  Struct.field('bool')
528
741
  ], entity_info.prototype, "is_idle", void 0);
@@ -548,18 +761,6 @@ var Types;
548
761
  Struct.type('entity_info')
549
762
  ], entity_info);
550
763
  Types.entity_info = entity_info;
551
- let entity_state = class entity_state extends Struct {
552
- };
553
- __decorate([
554
- Struct.field(coordinates)
555
- ], entity_state.prototype, "location", void 0);
556
- __decorate([
557
- Struct.field(UInt16)
558
- ], entity_state.prototype, "energy", void 0);
559
- entity_state = __decorate([
560
- Struct.type('entity_state')
561
- ], entity_state);
562
- Types.entity_state = entity_state;
563
764
  let entity_summary = class entity_summary extends Struct {
564
765
  };
565
766
  __decorate([
@@ -576,7 +777,7 @@ var Types;
576
777
  ], entity_summary.prototype, "entity_name", void 0);
577
778
  __decorate([
578
779
  Struct.field(coordinates)
579
- ], entity_summary.prototype, "location", void 0);
780
+ ], entity_summary.prototype, "coordinates", void 0);
580
781
  __decorate([
581
782
  Struct.field('bool')
582
783
  ], entity_summary.prototype, "is_idle", void 0);
@@ -608,6 +809,42 @@ var Types;
608
809
  Struct.type('entity_task_info')
609
810
  ], entity_task_info);
610
811
  Types.entity_task_info = entity_task_info;
812
+ let entitygroup_row = class entitygroup_row extends Struct {
813
+ };
814
+ __decorate([
815
+ Struct.field(UInt64)
816
+ ], entitygroup_row.prototype, "id", void 0);
817
+ __decorate([
818
+ Struct.field(entity_ref, { array: true })
819
+ ], entitygroup_row.prototype, "participants", void 0);
820
+ entitygroup_row = __decorate([
821
+ Struct.type('entitygroup_row')
822
+ ], entitygroup_row);
823
+ Types.entitygroup_row = entitygroup_row;
824
+ let extract = class extract extends Struct {
825
+ };
826
+ __decorate([
827
+ Struct.field(Name)
828
+ ], extract.prototype, "entity_type", void 0);
829
+ __decorate([
830
+ Struct.field(UInt64)
831
+ ], extract.prototype, "id", void 0);
832
+ __decorate([
833
+ Struct.field(UInt16)
834
+ ], extract.prototype, "stratum", void 0);
835
+ __decorate([
836
+ Struct.field(UInt32)
837
+ ], extract.prototype, "quantity", void 0);
838
+ extract = __decorate([
839
+ Struct.type('extract')
840
+ ], extract);
841
+ Types.extract = extract;
842
+ let getconfig = class getconfig extends Struct {
843
+ };
844
+ getconfig = __decorate([
845
+ Struct.type('getconfig')
846
+ ], getconfig);
847
+ Types.getconfig = getconfig;
611
848
  let getentities = class getentities extends Struct {
612
849
  };
613
850
  __decorate([
@@ -632,12 +869,12 @@ var Types;
632
869
  Struct.type('getentity')
633
870
  ], getentity);
634
871
  Types.getentity = getentity;
635
- let getgoods = class getgoods extends Struct {
872
+ let getitems = class getitems extends Struct {
636
873
  };
637
- getgoods = __decorate([
638
- Struct.type('getgoods')
639
- ], getgoods);
640
- Types.getgoods = getgoods;
874
+ getitems = __decorate([
875
+ Struct.type('getitems')
876
+ ], getitems);
877
+ Types.getitems = getitems;
641
878
  let getlocation = class getlocation extends Struct {
642
879
  };
643
880
  __decorate([
@@ -650,6 +887,18 @@ var Types;
650
887
  Struct.type('getlocation')
651
888
  ], getlocation);
652
889
  Types.getlocation = getlocation;
890
+ let getlocdata = class getlocdata extends Struct {
891
+ };
892
+ __decorate([
893
+ Struct.field(Int64)
894
+ ], getlocdata.prototype, "x", void 0);
895
+ __decorate([
896
+ Struct.field(Int64)
897
+ ], getlocdata.prototype, "y", void 0);
898
+ getlocdata = __decorate([
899
+ Struct.type('getlocdata')
900
+ ], getlocdata);
901
+ Types.getlocdata = getlocdata;
653
902
  let getnearby = class getnearby extends Struct {
654
903
  };
655
904
  __decorate([
@@ -674,6 +923,12 @@ var Types;
674
923
  Struct.type('getplayer')
675
924
  ], getplayer);
676
925
  Types.getplayer = getplayer;
926
+ let getstarter = class getstarter extends Struct {
927
+ };
928
+ getstarter = __decorate([
929
+ Struct.type('getstarter')
930
+ ], getstarter);
931
+ Types.getstarter = getstarter;
677
932
  let getsummaries = class getsummaries extends Struct {
678
933
  };
679
934
  __decorate([
@@ -686,30 +941,24 @@ var Types;
686
941
  Struct.type('getsummaries')
687
942
  ], getsummaries);
688
943
  Types.getsummaries = getsummaries;
689
- let good = class good extends Struct {
944
+ let grouptravel = class grouptravel extends Struct {
690
945
  };
691
946
  __decorate([
692
- Struct.field(UInt16)
693
- ], good.prototype, "id", void 0);
947
+ Struct.field(entity_ref, { array: true })
948
+ ], grouptravel.prototype, "entities", void 0);
694
949
  __decorate([
695
- Struct.field(UInt32)
696
- ], good.prototype, "base_price", void 0);
950
+ Struct.field(Int64)
951
+ ], grouptravel.prototype, "x", void 0);
697
952
  __decorate([
698
- Struct.field(UInt32)
699
- ], good.prototype, "mass", void 0);
700
- good = __decorate([
701
- Struct.type('good')
702
- ], good);
703
- Types.good = good;
704
- let goods_info = class goods_info extends Struct {
705
- };
953
+ Struct.field(Int64)
954
+ ], grouptravel.prototype, "y", void 0);
706
955
  __decorate([
707
- Struct.field(good, { array: true })
708
- ], goods_info.prototype, "goods", void 0);
709
- goods_info = __decorate([
710
- Struct.type('goods_info')
711
- ], goods_info);
712
- Types.goods_info = goods_info;
956
+ Struct.field('bool')
957
+ ], grouptravel.prototype, "recharge", void 0);
958
+ grouptravel = __decorate([
959
+ Struct.type('grouptravel')
960
+ ], grouptravel);
961
+ Types.grouptravel = grouptravel;
713
962
  let hash = class hash extends Struct {
714
963
  };
715
964
  __decorate([
@@ -737,6 +986,15 @@ var Types;
737
986
  Struct.type('init')
738
987
  ], init);
739
988
  Types.init = init;
989
+ let items_info = class items_info extends Struct {
990
+ };
991
+ __decorate([
992
+ Struct.field(item_def, { array: true })
993
+ ], items_info.prototype, "items", void 0);
994
+ items_info = __decorate([
995
+ Struct.type('items_info')
996
+ ], items_info);
997
+ Types.items_info = items_info;
740
998
  let join = class join extends Struct {
741
999
  };
742
1000
  __decorate([
@@ -746,27 +1004,75 @@ var Types;
746
1004
  Struct.type('join')
747
1005
  ], join);
748
1006
  Types.join = join;
749
- let location_good = class location_good extends Struct {
1007
+ let location_static = class location_static extends Struct {
1008
+ };
1009
+ __decorate([
1010
+ Struct.field(coordinates)
1011
+ ], location_static.prototype, "coords", void 0);
1012
+ __decorate([
1013
+ Struct.field(UInt8)
1014
+ ], location_static.prototype, "type", void 0);
1015
+ __decorate([
1016
+ Struct.field(UInt8)
1017
+ ], location_static.prototype, "subtype", void 0);
1018
+ __decorate([
1019
+ Struct.field(UInt8)
1020
+ ], location_static.prototype, "seed0", void 0);
1021
+ __decorate([
1022
+ Struct.field(UInt8)
1023
+ ], location_static.prototype, "seed1", void 0);
1024
+ location_static = __decorate([
1025
+ Struct.type('location_static')
1026
+ ], location_static);
1027
+ Types.location_static = location_static;
1028
+ let location_epoch = class location_epoch extends Struct {
1029
+ };
1030
+ __decorate([
1031
+ Struct.field('bool')
1032
+ ], location_epoch.prototype, "active", void 0);
1033
+ __decorate([
1034
+ Struct.field(UInt8)
1035
+ ], location_epoch.prototype, "seed0", void 0);
1036
+ __decorate([
1037
+ Struct.field(UInt8)
1038
+ ], location_epoch.prototype, "seed1", void 0);
1039
+ location_epoch = __decorate([
1040
+ Struct.type('location_epoch')
1041
+ ], location_epoch);
1042
+ Types.location_epoch = location_epoch;
1043
+ let location_derived = class location_derived extends Struct {
1044
+ };
1045
+ __decorate([
1046
+ Struct.field(location_static)
1047
+ ], location_derived.prototype, "static_props", void 0);
1048
+ __decorate([
1049
+ Struct.field(location_epoch)
1050
+ ], location_derived.prototype, "epoch_props", void 0);
1051
+ location_derived = __decorate([
1052
+ Struct.type('location_derived')
1053
+ ], location_derived);
1054
+ Types.location_derived = location_derived;
1055
+ let location_item = class location_item extends Struct {
750
1056
  };
751
1057
  __decorate([
752
1058
  Struct.field(UInt16)
753
- ], location_good.prototype, "id", void 0);
1059
+ ], location_item.prototype, "id", void 0);
754
1060
  __decorate([
755
1061
  Struct.field(UInt32)
756
- ], location_good.prototype, "price", void 0);
1062
+ ], location_item.prototype, "price", void 0);
757
1063
  __decorate([
758
1064
  Struct.field(UInt16)
759
- ], location_good.prototype, "supply", void 0);
1065
+ ], location_item.prototype, "supply", void 0);
760
1066
  __decorate([
761
1067
  Struct.field(UInt32)
762
- ], location_good.prototype, "rarity_multiplier", void 0);
1068
+ ], location_item.prototype, "rarity_multiplier", void 0);
763
1069
  __decorate([
764
1070
  Struct.field(UInt32)
765
- ], location_good.prototype, "location_multiplier", void 0);
766
- location_good = __decorate([
767
- Struct.type('location_good')
768
- ], location_good);
769
- Types.location_good = location_good;
1071
+ ], location_item.prototype, "location_multiplier", void 0);
1072
+ location_item = __decorate([
1073
+ Struct.type('location_item')
1074
+ ], location_item);
1075
+ Types.location_item = location_item;
770
1076
  let location_info = class location_info extends Struct {
771
1077
  };
772
1078
  __decorate([
@@ -776,8 +1082,8 @@ var Types;
776
1082
  Struct.field('bool')
777
1083
  ], location_info.prototype, "is_system", void 0);
778
1084
  __decorate([
779
- Struct.field(location_good, { array: true })
780
- ], location_info.prototype, "goods", void 0);
1085
+ Struct.field(location_item, { array: true })
1086
+ ], location_info.prototype, "items", void 0);
781
1087
  location_info = __decorate([
782
1088
  Struct.type('location_info')
783
1089
  ], location_info);
@@ -787,85 +1093,25 @@ var Types;
787
1093
  __decorate([
788
1094
  Struct.field(UInt64)
789
1095
  ], location_row.prototype, "id", void 0);
1096
+ __decorate([
1097
+ Struct.field(Name)
1098
+ ], location_row.prototype, "owner", void 0);
790
1099
  __decorate([
791
1100
  Struct.field(coordinates)
792
1101
  ], location_row.prototype, "coordinates", void 0);
793
1102
  __decorate([
794
- Struct.field(UInt64)
795
- ], location_row.prototype, "epoch", void 0);
1103
+ Struct.field(UInt32)
1104
+ ], location_row.prototype, "cargomass", void 0);
796
1105
  __decorate([
797
- Struct.field(UInt16)
798
- ], location_row.prototype, "good_id", void 0);
1106
+ Struct.field(cargo_item, { array: true })
1107
+ ], location_row.prototype, "cargo", void 0);
799
1108
  __decorate([
800
- Struct.field(UInt16)
801
- ], location_row.prototype, "supply", void 0);
1109
+ Struct.field(schedule, { optional: true })
1110
+ ], location_row.prototype, "schedule", void 0);
802
1111
  location_row = __decorate([
803
1112
  Struct.type('location_row')
804
1113
  ], location_row);
805
1114
  Types.location_row = location_row;
806
- let logcancel = class logcancel extends Struct {
807
- };
808
- __decorate([
809
- Struct.field(cancel_log)
810
- ], logcancel.prototype, "log", void 0);
811
- logcancel = __decorate([
812
- Struct.type('logcancel')
813
- ], logcancel);
814
- Types.logcancel = logcancel;
815
- let resolve_log = class resolve_log extends Struct {
816
- };
817
- __decorate([
818
- Struct.field(Name)
819
- ], resolve_log.prototype, "owner", void 0);
820
- __decorate([
821
- Struct.field(Name)
822
- ], resolve_log.prototype, "entity_type", void 0);
823
- __decorate([
824
- Struct.field(UInt64)
825
- ], resolve_log.prototype, "entity_id", void 0);
826
- __decorate([
827
- Struct.field(UInt8)
828
- ], resolve_log.prototype, "task_index", void 0);
829
- __decorate([
830
- Struct.field(task)
831
- ], resolve_log.prototype, "task", void 0);
832
- __decorate([
833
- Struct.field(TimePoint)
834
- ], resolve_log.prototype, "started_at", void 0);
835
- __decorate([
836
- Struct.field(TimePoint)
837
- ], resolve_log.prototype, "completed_at", void 0);
838
- __decorate([
839
- Struct.field(UInt16, { optional: true })
840
- ], resolve_log.prototype, "new_energy", void 0);
841
- __decorate([
842
- Struct.field(coordinates, { optional: true })
843
- ], resolve_log.prototype, "new_location", void 0);
844
- __decorate([
845
- Struct.field(Int64)
846
- ], resolve_log.prototype, "cargomass_delta", void 0);
847
- __decorate([
848
- Struct.field(cargo_item, { array: true })
849
- ], resolve_log.prototype, "cargo_added", void 0);
850
- __decorate([
851
- Struct.field(cargo_item, { array: true })
852
- ], resolve_log.prototype, "cargo_removed", void 0);
853
- __decorate([
854
- Struct.field(Int64, { optional: true })
855
- ], resolve_log.prototype, "credits", void 0);
856
- resolve_log = __decorate([
857
- Struct.type('resolve_log')
858
- ], resolve_log);
859
- Types.resolve_log = resolve_log;
860
- let logresolve = class logresolve extends Struct {
861
- };
862
- __decorate([
863
- Struct.field(resolve_log)
864
- ], logresolve.prototype, "log", void 0);
865
- logresolve = __decorate([
866
- Struct.type('logresolve')
867
- ], logresolve);
868
- Types.logresolve = logresolve;
869
1115
  let nearby_system = class nearby_system extends Struct {
870
1116
  };
871
1117
  __decorate([
@@ -890,10 +1136,10 @@ var Types;
890
1136
  Struct.field('bool')
891
1137
  ], nearby_info.prototype, "can_travel", void 0);
892
1138
  __decorate([
893
- Struct.field(entity_state)
1139
+ Struct.field(entity_current_state)
894
1140
  ], nearby_info.prototype, "current", void 0);
895
1141
  __decorate([
896
- Struct.field(entity_state)
1142
+ Struct.field(entity_current_state)
897
1143
  ], nearby_info.prototype, "projected", void 0);
898
1144
  __decorate([
899
1145
  Struct.field(UInt16)
@@ -905,6 +1151,48 @@ var Types;
905
1151
  Struct.type('nearby_info')
906
1152
  ], nearby_info);
907
1153
  Types.nearby_info = nearby_info;
1154
+ let task_event = class task_event extends Struct {
1155
+ };
1156
+ __decorate([
1157
+ Struct.field(UInt8)
1158
+ ], task_event.prototype, "event_type", void 0);
1159
+ __decorate([
1160
+ Struct.field(Name)
1161
+ ], task_event.prototype, "owner", void 0);
1162
+ __decorate([
1163
+ Struct.field(Name)
1164
+ ], task_event.prototype, "entity_type", void 0);
1165
+ __decorate([
1166
+ Struct.field(UInt64)
1167
+ ], task_event.prototype, "entity_id", void 0);
1168
+ __decorate([
1169
+ Struct.field(UInt8)
1170
+ ], task_event.prototype, "task_index", void 0);
1171
+ __decorate([
1172
+ Struct.field(task)
1173
+ ], task_event.prototype, "task", void 0);
1174
+ __decorate([
1175
+ Struct.field(TimePoint)
1176
+ ], task_event.prototype, "starts_at", void 0);
1177
+ __decorate([
1178
+ Struct.field(TimePoint)
1179
+ ], task_event.prototype, "completes_at", void 0);
1180
+ __decorate([
1181
+ Struct.field(UInt16, { optional: true })
1182
+ ], task_event.prototype, "new_energy", void 0);
1183
+ task_event = __decorate([
1184
+ Struct.type('task_event')
1185
+ ], task_event);
1186
+ Types.task_event = task_event;
1187
+ let notify = class notify extends Struct {
1188
+ };
1189
+ __decorate([
1190
+ Struct.field(task_event)
1191
+ ], notify.prototype, "event", void 0);
1192
+ notify = __decorate([
1193
+ Struct.type('notify')
1194
+ ], notify);
1195
+ Types.notify = notify;
908
1196
  let payloan = class payloan extends Struct {
909
1197
  };
910
1198
  __decorate([
@@ -946,12 +1234,18 @@ var Types;
946
1234
  __decorate([
947
1235
  Struct.field(UInt64)
948
1236
  ], player_info.prototype, "next_warehouse_price", void 0);
1237
+ __decorate([
1238
+ Struct.field(UInt64)
1239
+ ], player_info.prototype, "next_container_price", void 0);
949
1240
  __decorate([
950
1241
  Struct.field(UInt64)
951
1242
  ], player_info.prototype, "ship_count", void 0);
952
1243
  __decorate([
953
1244
  Struct.field(UInt64)
954
1245
  ], player_info.prototype, "warehouse_count", void 0);
1246
+ __decorate([
1247
+ Struct.field(UInt64)
1248
+ ], player_info.prototype, "container_count", void 0);
955
1249
  player_info = __decorate([
956
1250
  Struct.type('player_info')
957
1251
  ], player_info);
@@ -995,6 +1289,18 @@ var Types;
995
1289
  Struct.type('recharge')
996
1290
  ], recharge);
997
1291
  Types.recharge = recharge;
1292
+ let reserve_row = class reserve_row extends Struct {
1293
+ };
1294
+ __decorate([
1295
+ Struct.field(UInt64)
1296
+ ], reserve_row.prototype, "id", void 0);
1297
+ __decorate([
1298
+ Struct.field(UInt32)
1299
+ ], reserve_row.prototype, "remaining", void 0);
1300
+ reserve_row = __decorate([
1301
+ Struct.type('reserve_row')
1302
+ ], reserve_row);
1303
+ Types.reserve_row = reserve_row;
998
1304
  let resolve = class resolve extends Struct {
999
1305
  };
1000
1306
  __decorate([
@@ -1003,6 +1309,9 @@ var Types;
1003
1309
  __decorate([
1004
1310
  Struct.field(UInt64)
1005
1311
  ], resolve.prototype, "id", void 0);
1312
+ __decorate([
1313
+ Struct.field(UInt64, { optional: true })
1314
+ ], resolve.prototype, "count", void 0);
1006
1315
  resolve = __decorate([
1007
1316
  Struct.type('resolve')
1008
1317
  ], resolve);
@@ -1021,6 +1330,12 @@ var Types;
1021
1330
  __decorate([
1022
1331
  Struct.field(TimePoint, { optional: true })
1023
1332
  ], resolve_results.prototype, "new_schedule_started", void 0);
1333
+ __decorate([
1334
+ Struct.field(UInt64, { optional: true })
1335
+ ], resolve_results.prototype, "entitygroup", void 0);
1336
+ __decorate([
1337
+ Struct.field(entity_ref, { array: true, optional: true })
1338
+ ], resolve_results.prototype, "group_members", void 0);
1024
1339
  resolve_results = __decorate([
1025
1340
  Struct.type('resolve_results')
1026
1341
  ], resolve_results);
@@ -1034,21 +1349,24 @@ var Types;
1034
1349
  Struct.type('salt')
1035
1350
  ], salt);
1036
1351
  Types.salt = salt;
1037
- let sellgoods = class sellgoods extends Struct {
1352
+ let sellitems = class sellitems extends Struct {
1038
1353
  };
1354
+ __decorate([
1355
+ Struct.field(Name)
1356
+ ], sellitems.prototype, "entity_type", void 0);
1039
1357
  __decorate([
1040
1358
  Struct.field(UInt64)
1041
- ], sellgoods.prototype, "ship_id", void 0);
1359
+ ], sellitems.prototype, "id", void 0);
1042
1360
  __decorate([
1043
1361
  Struct.field(UInt16)
1044
- ], sellgoods.prototype, "good_id", void 0);
1362
+ ], sellitems.prototype, "item_id", void 0);
1045
1363
  __decorate([
1046
1364
  Struct.field(UInt32)
1047
- ], sellgoods.prototype, "quantity", void 0);
1048
- sellgoods = __decorate([
1049
- Struct.type('sellgoods')
1050
- ], sellgoods);
1051
- Types.sellgoods = sellgoods;
1365
+ ], sellitems.prototype, "quantity", void 0);
1366
+ sellitems = __decorate([
1367
+ Struct.type('sellitems')
1368
+ ], sellitems);
1369
+ Types.sellitems = sellitems;
1052
1370
  let sequence_row = class sequence_row extends Struct {
1053
1371
  };
1054
1372
  __decorate([
@@ -1074,16 +1392,19 @@ var Types;
1074
1392
  ], ship_row.prototype, "name", void 0);
1075
1393
  __decorate([
1076
1394
  Struct.field(coordinates)
1077
- ], ship_row.prototype, "location", void 0);
1395
+ ], ship_row.prototype, "coordinates", void 0);
1078
1396
  __decorate([
1079
1397
  Struct.field(UInt32)
1080
- ], ship_row.prototype, "mass", void 0);
1398
+ ], ship_row.prototype, "hullmass", void 0);
1081
1399
  __decorate([
1082
1400
  Struct.field(UInt32)
1083
1401
  ], ship_row.prototype, "capacity", void 0);
1084
1402
  __decorate([
1085
1403
  Struct.field(UInt16)
1086
1404
  ], ship_row.prototype, "energy", void 0);
1405
+ __decorate([
1406
+ Struct.field(UInt32)
1407
+ ], ship_row.prototype, "cargomass", void 0);
1087
1408
  __decorate([
1088
1409
  Struct.field(movement_stats)
1089
1410
  ], ship_row.prototype, "engines", void 0);
@@ -1093,6 +1414,15 @@ var Types;
1093
1414
  __decorate([
1094
1415
  Struct.field(loader_stats)
1095
1416
  ], ship_row.prototype, "loaders", void 0);
1417
+ __decorate([
1418
+ Struct.field(trade_stats, { optional: true })
1419
+ ], ship_row.prototype, "trade", void 0);
1420
+ __decorate([
1421
+ Struct.field(extractor_stats, { optional: true })
1422
+ ], ship_row.prototype, "extractor", void 0);
1423
+ __decorate([
1424
+ Struct.field(warp_stats, { optional: true })
1425
+ ], ship_row.prototype, "warp", void 0);
1096
1426
  __decorate([
1097
1427
  Struct.field(schedule, { optional: true })
1098
1428
  ], ship_row.prototype, "schedule", void 0);
@@ -1100,6 +1430,21 @@ var Types;
1100
1430
  Struct.type('ship_row')
1101
1431
  ], ship_row);
1102
1432
  Types.ship_row = ship_row;
1433
+ let starter_info = class starter_info extends Struct {
1434
+ };
1435
+ __decorate([
1436
+ Struct.field(UInt64)
1437
+ ], starter_info.prototype, "balance", void 0);
1438
+ __decorate([
1439
+ Struct.field(UInt64)
1440
+ ], starter_info.prototype, "debt", void 0);
1441
+ __decorate([
1442
+ Struct.field(entity_info)
1443
+ ], starter_info.prototype, "ship", void 0);
1444
+ starter_info = __decorate([
1445
+ Struct.type('starter_info')
1446
+ ], starter_info);
1447
+ Types.starter_info = starter_info;
1103
1448
  let state_row = class state_row extends Struct {
1104
1449
  };
1105
1450
  __decorate([
@@ -1124,6 +1469,27 @@ var Types;
1124
1469
  Struct.type('state_row')
1125
1470
  ], state_row);
1126
1471
  Types.state_row = state_row;
1472
+ let supply_row = class supply_row extends Struct {
1473
+ };
1474
+ __decorate([
1475
+ Struct.field(UInt64)
1476
+ ], supply_row.prototype, "id", void 0);
1477
+ __decorate([
1478
+ Struct.field(coordinates)
1479
+ ], supply_row.prototype, "coordinates", void 0);
1480
+ __decorate([
1481
+ Struct.field(UInt64)
1482
+ ], supply_row.prototype, "epoch", void 0);
1483
+ __decorate([
1484
+ Struct.field(UInt16)
1485
+ ], supply_row.prototype, "item_id", void 0);
1486
+ __decorate([
1487
+ Struct.field(UInt16)
1488
+ ], supply_row.prototype, "supply", void 0);
1489
+ supply_row = __decorate([
1490
+ Struct.type('supply_row')
1491
+ ], supply_row);
1492
+ Types.supply_row = supply_row;
1127
1493
  let takeloan = class takeloan extends Struct {
1128
1494
  };
1129
1495
  __decorate([
@@ -1161,7 +1527,7 @@ var Types;
1161
1527
  ], transfer.prototype, "dest_id", void 0);
1162
1528
  __decorate([
1163
1529
  Struct.field(UInt16)
1164
- ], transfer.prototype, "good_id", void 0);
1530
+ ], transfer.prototype, "item_id", void 0);
1165
1531
  __decorate([
1166
1532
  Struct.field(UInt32)
1167
1533
  ], transfer.prototype, "quantity", void 0);
@@ -1198,6 +1564,12 @@ var Types;
1198
1564
  __decorate([
1199
1565
  Struct.field(entity_summary)
1200
1566
  ], types_row.prototype, "entity_summary_type", void 0);
1567
+ __decorate([
1568
+ Struct.field(starter_info)
1569
+ ], types_row.prototype, "starter_info_type", void 0);
1570
+ __decorate([
1571
+ Struct.field(game_config)
1572
+ ], types_row.prototype, "game_config_type", void 0);
1201
1573
  types_row = __decorate([
1202
1574
  Struct.type('types_row')
1203
1575
  ], types_row);
@@ -1239,10 +1611,13 @@ var Types;
1239
1611
  ], warehouse_row.prototype, "name", void 0);
1240
1612
  __decorate([
1241
1613
  Struct.field(coordinates)
1242
- ], warehouse_row.prototype, "location", void 0);
1614
+ ], warehouse_row.prototype, "coordinates", void 0);
1243
1615
  __decorate([
1244
1616
  Struct.field(UInt32)
1245
1617
  ], warehouse_row.prototype, "capacity", void 0);
1618
+ __decorate([
1619
+ Struct.field(UInt32)
1620
+ ], warehouse_row.prototype, "cargomass", void 0);
1246
1621
  __decorate([
1247
1622
  Struct.field(loader_stats)
1248
1623
  ], warehouse_row.prototype, "loaders", void 0);
@@ -1268,11 +1643,15 @@ var Types;
1268
1643
  })(Types || (Types = {}));
1269
1644
  const TableMap = {
1270
1645
  cargo: Types.cargo_row,
1646
+ container: Types.container_row,
1647
+ entitygroup: Types.entitygroup_row,
1271
1648
  location: Types.location_row,
1272
1649
  player: Types.player_row,
1650
+ reserve: Types.reserve_row,
1273
1651
  sequence: Types.sequence_row,
1274
1652
  ship: Types.ship_row,
1275
1653
  state: Types.state_row,
1654
+ supply: Types.supply_row,
1276
1655
  types: Types.types_row,
1277
1656
  warehouse: Types.warehouse_row,
1278
1657
  };
@@ -1315,11 +1694,11 @@ const ERROR_SYSTEM_DISABLED = 'This game is currently disabled.';
1315
1694
  const ERROR_SYSTEM_NOT_INITIALIZED = 'This game has not been initialized.';
1316
1695
  const GAME_NOT_FOUND = 'Cannot find game for given account name.';
1317
1696
  const GAME_SEED_NOT_SET = 'This game has not initialized an epoch seed value.';
1318
- const GOOD_DOES_NOT_EXIST = 'Good does not exist.';
1319
- const GOOD_NOT_AVAILABLE_AT_LOCATION = 'Good is not tradeable at ship location.';
1697
+ const ITEM_DOES_NOT_EXIST = 'Item does not exist.';
1698
+ const ITEM_NOT_AVAILABLE_AT_LOCATION = 'Item is not tradeable at ship location.';
1320
1699
  const INSUFFICIENT_BALANCE = 'Insufficient balance.';
1321
- const INSUFFICIENT_GOOD_QUANTITY = 'Insufficient quantity in cargo.';
1322
- const INSUFFICIENT_GOOD_SUPPLY = 'Insufficient supply of good at location.';
1700
+ const INSUFFICIENT_ITEM_QUANTITY = 'Insufficient quantity in cargo.';
1701
+ const INSUFFICIENT_ITEM_SUPPLY = 'Insufficient supply of item at location.';
1323
1702
  const INVALID_AMOUNT = 'Invalid amount.';
1324
1703
  const REQUIRES_MORE_THAN_ONE = 'A value greater than one is required.';
1325
1704
  const REQUIRES_POSITIVE_VALUE = 'Value must be greater than zero.';
@@ -1349,16 +1728,46 @@ const WAREHOUSE_ALREADY_AT_LOCATION = 'Warehouse already exists at this location
1349
1728
  const WAREHOUSE_CAPACITY_EXCEEDED = 'Warehouse capacity would be exceeded.';
1350
1729
 
1351
1730
  const PRECISION = 10000;
1352
- const INITIAL_SHIP_MASS = 500000;
1731
+ const INITIAL_SHIP_GENERATOR_CAPACITY = 350;
1732
+ const INITIAL_SHIP_DRAIN = 25;
1733
+ const INITIAL_SHIP_ENERGY = 350;
1734
+ const INITIAL_SHIP_HULLMASS = 100000;
1735
+ const INITIAL_SHIP_CAPACITY = 500000;
1736
+ const INITIAL_SHIP_Z = 800;
1737
+ const INITIAL_SHIP_RECHARGE = 10;
1738
+ const INITIAL_SHIP_THRUST = 250;
1739
+ const INITIAL_LOADER_MASS = 1000;
1740
+ const INITIAL_LOADER_QUANTITY = 1;
1741
+ const INITIAL_LOADER_THRUST = 1;
1742
+ const WAREHOUSE_Z = 500;
1743
+ const INITIAL_WAREHOUSE_CAPACITY = 10000000;
1744
+ const CONTAINER_Z = 300;
1745
+ const INITIAL_CONTAINER_HULLMASS = 50000;
1746
+ const INITIAL_CONTAINER_CAPACITY = 2000000;
1747
+ const TRAVEL_MAX_DURATION = 86400;
1353
1748
  const MIN_ORBITAL_ALTITUDE = 800;
1354
1749
  const MAX_ORBITAL_ALTITUDE = 3000;
1750
+ const INITIAL_SHIP_MASS = 500000;
1751
+ const INITIAL_EXTRACTOR_RATE = 700;
1752
+ const INITIAL_EXTRACTOR_DRAIN = 2500;
1753
+ const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
1355
1754
  var TaskType;
1356
1755
  (function (TaskType) {
1357
- TaskType[TaskType["RECHARGE"] = 0] = "RECHARGE";
1358
- TaskType[TaskType["LOAD"] = 1] = "LOAD";
1359
- TaskType[TaskType["UNLOAD"] = 2] = "UNLOAD";
1360
- TaskType[TaskType["FLIGHT"] = 3] = "FLIGHT";
1756
+ TaskType[TaskType["IDLE"] = 0] = "IDLE";
1757
+ TaskType[TaskType["TRAVEL"] = 1] = "TRAVEL";
1758
+ TaskType[TaskType["RECHARGE"] = 2] = "RECHARGE";
1759
+ TaskType[TaskType["LOAD"] = 3] = "LOAD";
1760
+ TaskType[TaskType["UNLOAD"] = 4] = "UNLOAD";
1761
+ TaskType[TaskType["EXTRACT"] = 5] = "EXTRACT";
1762
+ TaskType[TaskType["WARP"] = 6] = "WARP";
1361
1763
  })(TaskType || (TaskType = {}));
1764
+ var LocationType;
1765
+ (function (LocationType) {
1766
+ LocationType[LocationType["EMPTY"] = 0] = "EMPTY";
1767
+ LocationType[LocationType["PLANET"] = 1] = "PLANET";
1768
+ LocationType[LocationType["ASTEROID"] = 2] = "ASTEROID";
1769
+ LocationType[LocationType["NEBULA"] = 3] = "NEBULA";
1770
+ })(LocationType || (LocationType = {}));
1362
1771
  var TaskCancelable;
1363
1772
  (function (TaskCancelable) {
1364
1773
  TaskCancelable[TaskCancelable["NEVER"] = 0] = "NEVER";
@@ -1368,6 +1777,7 @@ var TaskCancelable;
1368
1777
  const EntityType = {
1369
1778
  SHIP: Name.from('ship'),
1370
1779
  WAREHOUSE: Name.from('warehouse'),
1780
+ CONTAINER: Name.from('container'),
1371
1781
  };
1372
1782
  class Coordinates extends Types.coordinates {
1373
1783
  static from(value) {
@@ -1377,44 +1787,64 @@ class Coordinates extends Types.coordinates {
1377
1787
  const coords = Coordinates.from(other);
1378
1788
  return this.x.equals(coords.x) && this.y.equals(coords.y);
1379
1789
  }
1790
+ toLocationId() {
1791
+ return coordsToLocationId(this);
1792
+ }
1793
+ }
1794
+ function coordsToLocationId(coords) {
1795
+ const c = Coordinates.from(coords);
1796
+ const mask = BigInt(0xffffffff);
1797
+ const x = BigInt(c.x.toNumber()) & mask;
1798
+ const y = BigInt(c.y.toNumber()) & mask;
1799
+ const id = (x << BigInt(32)) | y;
1800
+ return UInt64.from(id);
1380
1801
  }
1381
- let Good = class Good extends Struct {
1802
+ let Item = class Item extends Struct {
1382
1803
  };
1383
1804
  __decorate([
1384
1805
  Struct.field(UInt16)
1385
- ], Good.prototype, "id", void 0);
1806
+ ], Item.prototype, "id", void 0);
1386
1807
  __decorate([
1387
1808
  Struct.field('string')
1388
- ], Good.prototype, "name", void 0);
1809
+ ], Item.prototype, "name", void 0);
1389
1810
  __decorate([
1390
1811
  Struct.field('string')
1391
- ], Good.prototype, "description", void 0);
1812
+ ], Item.prototype, "description", void 0);
1392
1813
  __decorate([
1393
1814
  Struct.field(UInt32)
1394
- ], Good.prototype, "base_price", void 0);
1815
+ ], Item.prototype, "base_price", void 0);
1395
1816
  __decorate([
1396
1817
  Struct.field(UInt32)
1397
- ], Good.prototype, "mass", void 0);
1398
- Good = __decorate([
1399
- Struct.type('good')
1400
- ], Good);
1401
- let GoodPrice = class GoodPrice extends Struct {
1818
+ ], Item.prototype, "mass", void 0);
1819
+ __decorate([
1820
+ Struct.field('string')
1821
+ ], Item.prototype, "category", void 0);
1822
+ __decorate([
1823
+ Struct.field('string')
1824
+ ], Item.prototype, "rarity", void 0);
1825
+ __decorate([
1826
+ Struct.field('string')
1827
+ ], Item.prototype, "color", void 0);
1828
+ Item = __decorate([
1829
+ Struct.type('item')
1830
+ ], Item);
1831
+ let ItemPrice = class ItemPrice extends Struct {
1402
1832
  };
1403
1833
  __decorate([
1404
1834
  Struct.field(UInt16)
1405
- ], GoodPrice.prototype, "id", void 0);
1835
+ ], ItemPrice.prototype, "id", void 0);
1406
1836
  __decorate([
1407
- Struct.field(Good)
1408
- ], GoodPrice.prototype, "good", void 0);
1837
+ Struct.field(Item)
1838
+ ], ItemPrice.prototype, "item", void 0);
1409
1839
  __decorate([
1410
1840
  Struct.field(UInt32)
1411
- ], GoodPrice.prototype, "price", void 0);
1841
+ ], ItemPrice.prototype, "price", void 0);
1412
1842
  __decorate([
1413
1843
  Struct.field(UInt16)
1414
- ], GoodPrice.prototype, "supply", void 0);
1415
- GoodPrice = __decorate([
1416
- Struct.type('GoodPrice')
1417
- ], GoodPrice);
1844
+ ], ItemPrice.prototype, "supply", void 0);
1845
+ ItemPrice = __decorate([
1846
+ Struct.type('ItemPrice')
1847
+ ], ItemPrice);
1418
1848
 
1419
1849
  function getCurrentEpoch(game) {
1420
1850
  const current = new Date().getTime();
@@ -2628,6 +3058,26 @@ var syllables = [
2628
3058
  "Zyn"
2629
3059
  ];
2630
3060
 
3061
+ const LOCATION_EXISTS_THRESHOLD = 0x10;
3062
+ const LOCATION_ACTIVE_THRESHOLD = 0x80;
3063
+ function getLocationType(gameSeed, coordinates) {
3064
+ const seed = Checksum256.from(gameSeed);
3065
+ const str = ['system', coordinates.x, coordinates.y].join('-');
3066
+ const hashResult = hash512(seed, str);
3067
+ if (hashResult.array[0] >= LOCATION_EXISTS_THRESHOLD) {
3068
+ return LocationType.EMPTY;
3069
+ }
3070
+ if (hashResult.array[1] < 96) {
3071
+ return LocationType.PLANET;
3072
+ }
3073
+ else if (hashResult.array[1] < 176) {
3074
+ return LocationType.ASTEROID;
3075
+ }
3076
+ return LocationType.NEBULA;
3077
+ }
3078
+ function isExtractableLocation(locationType) {
3079
+ return locationType !== LocationType.EMPTY;
3080
+ }
2631
3081
  function getSystemName(gameSeed, location) {
2632
3082
  const seed = Checksum256.from(gameSeed);
2633
3083
  if (!hasSystem(seed, location)) {
@@ -2645,9 +3095,55 @@ function getSystemName(gameSeed, location) {
2645
3095
  return name.join('');
2646
3096
  }
2647
3097
  function hasSystem(gameSeed, coordinates) {
3098
+ return getLocationType(gameSeed, coordinates) !== LocationType.EMPTY;
3099
+ }
3100
+ function deriveLocationStatic(gameSeed, coordinates) {
2648
3101
  const seed = Checksum256.from(gameSeed);
2649
- const str = ['system', coordinates.x, coordinates.y].join('-');
2650
- return String(hash512(seed, str)).slice(0, 2) === '00';
3102
+ const coords = Coordinates.from(coordinates);
3103
+ const str = `system-${coords.x}-${coords.y}`;
3104
+ const hashResult = hash512(seed, str);
3105
+ const loc = Types.location_static.from({
3106
+ coords: coords,
3107
+ type: LocationType.EMPTY,
3108
+ subtype: 0,
3109
+ seed0: 0,
3110
+ seed1: 0,
3111
+ });
3112
+ if (hashResult.array[0] >= LOCATION_EXISTS_THRESHOLD) {
3113
+ return loc;
3114
+ }
3115
+ if (hashResult.array[1] < 96) {
3116
+ loc.type = UInt8.from(LocationType.PLANET);
3117
+ }
3118
+ else if (hashResult.array[1] < 176) {
3119
+ loc.type = UInt8.from(LocationType.ASTEROID);
3120
+ }
3121
+ else {
3122
+ loc.type = UInt8.from(LocationType.NEBULA);
3123
+ }
3124
+ loc.subtype = UInt8.from(Number(loc.type) === LocationType.PLANET
3125
+ ? hashResult.array[2] % 6
3126
+ : hashResult.array[2]);
3127
+ loc.seed0 = UInt8.from(hashResult.array[3]);
3128
+ loc.seed1 = UInt8.from(hashResult.array[4]);
3129
+ return loc;
3130
+ }
3131
+ function deriveLocationEpoch(epochSeed, coordinates) {
3132
+ const seed = Checksum256.from(epochSeed);
3133
+ const coords = Coordinates.from(coordinates);
3134
+ const str = `system-epoch-${coords.x}-${coords.y}`;
3135
+ const hashResult = hash512(seed, str);
3136
+ return Types.location_epoch.from({
3137
+ active: hashResult.array[0] < LOCATION_ACTIVE_THRESHOLD,
3138
+ seed0: hashResult.array[1],
3139
+ seed1: hashResult.array[2],
3140
+ });
3141
+ }
3142
+ function deriveLocation(gameSeed, epochSeed, coordinates) {
3143
+ return Types.location_derived.from({
3144
+ static_props: deriveLocationStatic(gameSeed, coordinates),
3145
+ epoch_props: deriveLocationEpoch(epochSeed, coordinates),
3146
+ });
2651
3147
  }
2652
3148
 
2653
3149
  class GameState extends Types.state_row {
@@ -2743,47 +3239,170 @@ class BaseManager {
2743
3239
  }
2744
3240
  }
2745
3241
 
2746
- var goodsData = [
3242
+ var itemsData = [
2747
3243
  {
2748
3244
  id: 1,
2749
3245
  name: "Hydrogen",
2750
- description: "A lightweight fuel source essential for interstellar travel.",
3246
+ description: "A lightweight gas used for fuel cells and propulsion.",
2751
3247
  base_price: 50,
2752
- mass: 15000
3248
+ mass: 15000,
3249
+ category: "gas",
3250
+ rarity: "common",
3251
+ color: "#7EC8E3"
2753
3252
  },
2754
3253
  {
2755
3254
  id: 2,
3255
+ name: "Helium",
3256
+ description: "An inert noble gas used in energy systems.",
3257
+ base_price: 75,
3258
+ mass: 2000,
3259
+ category: "gas",
3260
+ rarity: "uncommon",
3261
+ color: "#F5E6CC"
3262
+ },
3263
+ {
3264
+ id: 6,
3265
+ name: "Carbon",
3266
+ description: "A versatile element for life support and coatings.",
3267
+ base_price: 100,
3268
+ mass: 12000,
3269
+ category: "organic",
3270
+ rarity: "common",
3271
+ color: "#4A4A4A"
3272
+ },
3273
+ {
3274
+ id: 14,
3275
+ name: "Silicon",
3276
+ description: "A semiconductor used in sensors and computing.",
3277
+ base_price: 150,
3278
+ mass: 28000,
3279
+ category: "mineral",
3280
+ rarity: "common",
3281
+ color: "#B8A9C9"
3282
+ },
3283
+ {
3284
+ id: 18,
3285
+ name: "Argon",
3286
+ description: "A noble gas used in industrial and energy applications.",
3287
+ base_price: 60,
3288
+ mass: 8000,
3289
+ category: "gas",
3290
+ rarity: "rare",
3291
+ color: "#9B59B6"
3292
+ },
3293
+ {
3294
+ id: 22,
3295
+ name: "Titanium",
3296
+ description: "A strong, lightweight metal for ship construction.",
3297
+ base_price: 300,
3298
+ mass: 48000,
3299
+ category: "metal",
3300
+ rarity: "rare",
3301
+ color: "#C0C0C0"
3302
+ },
3303
+ {
3304
+ id: 26,
2756
3305
  name: "Iron",
2757
- description: "A versatile metal used in construction and manufacturing.",
3306
+ description: "A versatile metal used in hulls and structures.",
2758
3307
  base_price: 125,
2759
- mass: 40000
3308
+ mass: 40000,
3309
+ category: "metal",
3310
+ rarity: "common",
3311
+ color: "#B7410E"
2760
3312
  },
2761
3313
  {
2762
- id: 3,
3314
+ id: 29,
2763
3315
  name: "Copper",
2764
- description: "A conductive metal vital for electronics and wiring.",
3316
+ description: "A conductive metal for electronics and wiring.",
3317
+ base_price: 200,
3318
+ mass: 60000,
3319
+ category: "metal",
3320
+ rarity: "uncommon",
3321
+ color: "#B87333"
3322
+ },
3323
+ {
3324
+ id: 54,
3325
+ name: "Xenon",
3326
+ description: "A rare noble gas for advanced propulsion systems.",
3327
+ base_price: 175,
3328
+ mass: 20000,
3329
+ category: "gas",
3330
+ rarity: "epic",
3331
+ color: "#5B2C6F"
3332
+ },
3333
+ {
3334
+ id: 74,
3335
+ name: "Tungsten",
3336
+ description: "An extremely dense metal for heavy-duty applications.",
3337
+ base_price: 500,
3338
+ mass: 80000,
3339
+ category: "metal",
3340
+ rarity: "epic",
3341
+ color: "#708090"
3342
+ },
3343
+ {
3344
+ id: 1000,
3345
+ name: "Quartz",
3346
+ description: "A crystalline mineral for sensors and optics.",
2765
3347
  base_price: 200,
2766
- mass: 60000
3348
+ mass: 35000,
3349
+ category: "mineral",
3350
+ rarity: "uncommon",
3351
+ color: "#E8D5B7"
3352
+ },
3353
+ {
3354
+ id: 1001,
3355
+ name: "Sapphire",
3356
+ description: "A precious crystal for precision instruments.",
3357
+ base_price: 400,
3358
+ mass: 45000,
3359
+ category: "mineral",
3360
+ rarity: "rare",
3361
+ color: "#0F52BA"
3362
+ },
3363
+ {
3364
+ id: 1002,
3365
+ name: "Polymers",
3366
+ description: "Synthetic materials for coatings and consumables.",
3367
+ base_price: 150,
3368
+ mass: 25000,
3369
+ category: "organic",
3370
+ rarity: "rare",
3371
+ color: "#2ECC71"
3372
+ },
3373
+ {
3374
+ id: 1003,
3375
+ name: "Biomass",
3376
+ description: "Organic matter for life support systems.",
3377
+ base_price: 100,
3378
+ mass: 30000,
3379
+ category: "organic",
3380
+ rarity: "uncommon",
3381
+ color: "#8B4513"
2767
3382
  }
2768
3383
  ];
2769
3384
 
2770
- const goods = goodsData;
2771
- const goodIds = goods.map((g) => g.id);
2772
- function getGood(goodId) {
2773
- const good = goods.find((g) => UInt16.from(goodId).equals(g.id));
2774
- if (!good) {
2775
- throw new Error('Good does not exist');
2776
- }
2777
- return Good.from({
2778
- id: UInt16.from(good.id),
2779
- name: good.name,
2780
- description: good.description,
2781
- base_price: UInt32.from(good.base_price),
2782
- mass: UInt32.from(good.mass),
2783
- });
3385
+ const items = itemsData.map((g) => Item.from({
3386
+ id: g.id,
3387
+ name: g.name,
3388
+ description: g.description,
3389
+ base_price: g.base_price,
3390
+ mass: g.mass,
3391
+ category: g.category,
3392
+ rarity: g.rarity,
3393
+ color: g.color,
3394
+ }));
3395
+ const itemIds = items.map((i) => i.id);
3396
+ function getItem(itemId) {
3397
+ const id = UInt16.from(itemId);
3398
+ const item = items.find((i) => i.id.equals(id));
3399
+ if (!item) {
3400
+ throw new Error(`Item with id ${id} not found`);
3401
+ }
3402
+ return item;
2784
3403
  }
2785
- function getGoods() {
2786
- return goods.map((g) => getGood(g.id));
3404
+ function getItems() {
3405
+ return items;
2787
3406
  }
2788
3407
 
2789
3408
  function calc_orbital_altitude(mass) {
@@ -2850,7 +3469,7 @@ function calc_flighttime(distance, acceleration) {
2850
3469
  return UInt32.from(2 * Math.sqrt(Number(distance) / acceleration));
2851
3470
  }
2852
3471
  function calc_loader_flighttime(ship, mass, altitude) {
2853
- const z = altitude ?? ship.location.z?.toNumber() ?? calc_orbital_altitude(Number(mass));
3472
+ const z = altitude ?? ship.coordinates.z?.toNumber() ?? calc_orbital_altitude(Number(mass));
2854
3473
  return calc_flighttime(z, calc_loader_acceleration(ship, mass));
2855
3474
  }
2856
3475
  function calc_loader_acceleration(ship, mass) {
@@ -2868,12 +3487,12 @@ function calc_acceleration(thrust, mass) {
2868
3487
  }
2869
3488
  function calc_ship_mass(ship, cargos) {
2870
3489
  const mass = UInt64.from(0);
2871
- mass.add(ship.mass);
3490
+ mass.add(ship.hullmass);
2872
3491
  if (ship.loaders.quantity.gt(UInt32.zero)) {
2873
3492
  mass.add(ship.loaders.mass.multiplying(ship.loaders.quantity));
2874
3493
  }
2875
3494
  for (const cargo of cargos) {
2876
- mass.add(getGood(cargo.good_id).mass.multiplying(cargo.quantity));
3495
+ mass.add(getItem(cargo.item_id).mass.multiplying(cargo.quantity));
2877
3496
  }
2878
3497
  return mass;
2879
3498
  }
@@ -2883,9 +3502,9 @@ function calc_energyusage(distance, drain) {
2883
3502
  function calculateTransferTime(ship, cargos, quantities) {
2884
3503
  let mass = UInt64.from(0);
2885
3504
  for (const cargo of cargos) {
2886
- const qty = quantities?.get(Number(cargo.good_id)) ?? 0;
3505
+ const qty = quantities?.get(Number(cargo.item_id)) ?? 0;
2887
3506
  if (qty > 0) {
2888
- const good_mass = getGood(cargo.good_id).mass;
3507
+ const good_mass = getItem(cargo.item_id).mass;
2889
3508
  const cargo_mass = good_mass.multiplying(qty);
2890
3509
  mass = UInt64.from(mass).adding(cargo_mass);
2891
3510
  }
@@ -2908,11 +3527,11 @@ function calculateLoadTimeBreakdown(ship, cargos, loadQuantities, unloadQuantiti
2908
3527
  let mass_unload = UInt64.from(0);
2909
3528
  let mass_load = UInt64.from(0);
2910
3529
  for (const cargo of cargos) {
2911
- const goodId = Number(cargo.good_id);
3530
+ const goodId = Number(cargo.item_id);
2912
3531
  const loadQty = loadQuantities?.get(goodId) ?? 0;
2913
3532
  const unloadQty = unloadQuantities?.get(goodId) ?? 0;
2914
3533
  if (loadQty > 0 || unloadQty > 0) {
2915
- const good = getGood(cargo.good_id);
3534
+ const good = getItem(cargo.item_id);
2916
3535
  if (loadQty > 0) {
2917
3536
  const cargo_mass = good.mass.multiplying(loadQty);
2918
3537
  mass_load = UInt64.from(mass_load).adding(cargo_mass);
@@ -2972,17 +3591,56 @@ function estimateTravelTime(ship, travelMass, distance, options = {}) {
2972
3591
  };
2973
3592
  }
2974
3593
  function estimateDealTravelTime(ship, shipMass, distance, loadMass) {
2975
- const needsRecharge = !hasEnergyForDistance(ship, distance);
3594
+ const needsRecharge = !hasEnergyForDistance$1(ship, distance);
2976
3595
  const estimate = estimateTravelTime(ship, shipMass, distance, {
2977
3596
  needsRecharge,
2978
3597
  loadMass,
2979
3598
  });
2980
3599
  return estimate.total;
2981
3600
  }
2982
- function hasEnergyForDistance(ship, distance) {
3601
+ function hasEnergyForDistance$1(ship, distance) {
2983
3602
  const energyNeeded = UInt64.from(distance).dividing(PRECISION).multiplying(ship.engines.drain);
2984
3603
  return UInt64.from(ship.energy).gte(energyNeeded);
2985
3604
  }
3605
+ function getFlightOrigin(entity, flightTaskIndex) {
3606
+ if (!entity.schedule)
3607
+ return entity.coordinates;
3608
+ let origin = entity.coordinates;
3609
+ for (let i = 0; i < flightTaskIndex && i < entity.schedule.tasks.length; i++) {
3610
+ const task = entity.schedule.tasks[i];
3611
+ if (task.type.equals(TaskType.TRAVEL) && task.coordinates) {
3612
+ origin = task.coordinates;
3613
+ }
3614
+ }
3615
+ return origin;
3616
+ }
3617
+ function getDestinationLocation(entity) {
3618
+ if (!entity.schedule)
3619
+ return undefined;
3620
+ for (let i = entity.schedule.tasks.length - 1; i >= 0; i--) {
3621
+ const task = entity.schedule.tasks[i];
3622
+ if (task.type.equals(TaskType.TRAVEL) && task.coordinates) {
3623
+ return task.coordinates;
3624
+ }
3625
+ }
3626
+ return undefined;
3627
+ }
3628
+ function getPositionAt(entity, taskIndex, taskProgress) {
3629
+ if (!entity.schedule || entity.schedule.tasks.length === 0 || taskIndex < 0) {
3630
+ return entity.coordinates;
3631
+ }
3632
+ const task = entity.schedule.tasks[taskIndex];
3633
+ if (!task.type.equals(TaskType.TRAVEL) || !task.coordinates) {
3634
+ return getFlightOrigin(entity, taskIndex);
3635
+ }
3636
+ const origin = getFlightOrigin(entity, taskIndex);
3637
+ const destination = task.coordinates;
3638
+ const interpolated = lerp(origin, destination, taskProgress);
3639
+ return {
3640
+ x: Math.round(interpolated.x),
3641
+ y: Math.round(interpolated.y),
3642
+ };
3643
+ }
2986
3644
  function calc_transfer_duration(source, dest, cargoMass) {
2987
3645
  if (cargoMass === 0) {
2988
3646
  return 0;
@@ -3030,136 +3688,70 @@ function calc_transfer_duration(source, dest, cargoMass) {
3030
3688
  return Math.floor(flightTime / totalQuantity);
3031
3689
  }
3032
3690
 
3033
- class Location {
3034
- constructor(coordinates) {
3035
- this.coordinates = Coordinates.from(coordinates);
3036
- }
3037
- static from(coordinates) {
3038
- return new Location(Coordinates.from(coordinates));
3039
- }
3040
- hasSystemAt(gameSeed) {
3041
- const seed = Checksum256.from(gameSeed);
3042
- if (this._hasSystem === undefined || !this._gameSeed?.equals(seed)) {
3043
- this._gameSeed = seed;
3044
- this._hasSystem = hasSystem(seed, this.coordinates);
3045
- }
3046
- return this._hasSystem;
3047
- }
3048
- setMarketPrices(prices) {
3049
- this._marketPrices = prices;
3691
+ function capsHasMovement(caps) {
3692
+ return caps.engines !== undefined && caps.generator !== undefined;
3693
+ }
3694
+ function capsHasStorage(caps) {
3695
+ return caps.capacity !== undefined;
3696
+ }
3697
+ function capsHasLoaders(caps) {
3698
+ return caps.loaders !== undefined;
3699
+ }
3700
+ function capsHasTrade(caps) {
3701
+ return caps.trade !== undefined;
3702
+ }
3703
+ function capsHasExtractor(caps) {
3704
+ return caps.extractor !== undefined;
3705
+ }
3706
+ function capsHasMass(caps) {
3707
+ return caps.hullmass !== undefined;
3708
+ }
3709
+
3710
+ function calcCargoMass(entity) {
3711
+ let mass = UInt64.from(0);
3712
+ for (const item of entity.cargo) {
3713
+ const good = getItem(item.item_id);
3714
+ mass = mass.adding(good.mass.multiplying(item.quantity));
3050
3715
  }
3051
- get marketPrices() {
3052
- return this._marketPrices;
3053
- }
3054
- getPrice(goodId) {
3055
- if (!this._marketPrices)
3056
- return undefined;
3057
- return this._marketPrices.find((p) => p.id.equals(goodId));
3058
- }
3059
- findNearby(gameSeed, maxDistance = 20) {
3060
- return findNearbyPlanets(Checksum256.from(gameSeed), this.coordinates, maxDistance);
3061
- }
3062
- equals(other) {
3063
- const otherCoords = other instanceof Location ? other.coordinates : Coordinates.from(other);
3064
- return this.coordinates.equals(otherCoords);
3065
- }
3066
- setLocationRows(rows, epoch) {
3067
- this._locationRows = rows;
3068
- this._epoch = epoch;
3069
- }
3070
- get locationRows() {
3071
- return this._locationRows;
3072
- }
3073
- getSupply(goodId) {
3074
- if (!this._locationRows)
3075
- return undefined;
3076
- const row = this._locationRows.find((r) => r.good_id.equals(goodId) && this._epoch && r.epoch.equals(this._epoch));
3077
- return row ? row.supply : undefined;
3078
- }
3079
- get availableGoods() {
3080
- if (!this._locationRows)
3081
- return undefined;
3082
- return this._locationRows.filter((r) => this._epoch && r.epoch.equals(this._epoch) && r.supply.gt(UInt16.from(0)));
3083
- }
3084
- hasGood(goodId) {
3085
- const supply = this.getSupply(goodId);
3086
- return supply !== undefined && supply.gt(UInt16.from(0));
3087
- }
3088
- get epoch() {
3089
- return this._epoch;
3090
- }
3091
- get hasCachedData() {
3092
- return this._marketPrices !== undefined || this._locationRows !== undefined;
3093
- }
3094
- get hasSupplyData() {
3095
- return this._locationRows !== undefined;
3096
- }
3097
- clearCache() {
3098
- this._marketPrices = undefined;
3099
- this._locationRows = undefined;
3100
- this._epoch = undefined;
3101
- }
3102
- withUpdatedSupply(goodId, quantityDelta) {
3103
- const newLocation = Location.from(this.coordinates);
3104
- if (this._marketPrices) {
3105
- newLocation._marketPrices = this._marketPrices.map((price) => {
3106
- if (price.id.equals(goodId)) {
3107
- const currentSupply = UInt16.from(price.supply);
3108
- const delta = UInt16.from(Math.abs(quantityDelta));
3109
- const newSupply = quantityDelta < 0
3110
- ? currentSupply.gte(delta)
3111
- ? currentSupply.subtracting(delta)
3112
- : UInt16.from(0)
3113
- : currentSupply.adding(quantityDelta);
3114
- return GoodPrice.from({
3115
- id: price.id,
3116
- good: price.good,
3117
- price: price.price,
3118
- supply: newSupply,
3119
- });
3120
- }
3121
- return price;
3122
- });
3123
- }
3124
- if (this._locationRows && this._epoch) {
3125
- newLocation._locationRows = this._locationRows.map((row) => {
3126
- if (row.good_id.equals(goodId) && row.epoch.equals(this._epoch)) {
3127
- const currentSupply = UInt16.from(row.supply);
3128
- const delta = UInt16.from(Math.abs(quantityDelta));
3129
- const newSupply = quantityDelta < 0
3130
- ? currentSupply.gte(delta)
3131
- ? currentSupply.subtracting(delta)
3132
- : UInt16.from(0)
3133
- : currentSupply.adding(quantityDelta);
3134
- return Types.location_row.from({
3135
- id: row.id,
3136
- coordinates: row.coordinates,
3137
- epoch: row.epoch,
3138
- good_id: row.good_id,
3139
- supply: newSupply,
3140
- });
3141
- }
3142
- return row;
3143
- });
3144
- newLocation._epoch = this._epoch;
3145
- }
3146
- newLocation._gameSeed = this._gameSeed;
3147
- newLocation._hasSystem = this._hasSystem;
3148
- return newLocation;
3716
+ return mass;
3717
+ }
3718
+ function calcCargoValue(entity) {
3719
+ let value = UInt64.from(0);
3720
+ for (const item of entity.cargo) {
3721
+ value = value.adding(item.unit_cost.multiplying(item.quantity));
3149
3722
  }
3723
+ return value;
3150
3724
  }
3151
- function toLocation(coords) {
3152
- if (coords instanceof Location) {
3153
- return coords;
3154
- }
3155
- return Location.from(coords);
3725
+ function availableCapacity$1(entity) {
3726
+ const cargoMass = calcCargoMass(entity);
3727
+ return entity.capacity.gt(cargoMass)
3728
+ ? UInt64.from(entity.capacity).subtracting(cargoMass)
3729
+ : UInt64.from(0);
3730
+ }
3731
+ function availableCapacityFromMass(capacity, cargoMass) {
3732
+ const cap = UInt64.from(capacity);
3733
+ const mass = UInt64.from(cargoMass);
3734
+ return cap.gt(mass) ? cap.subtracting(mass) : UInt64.from(0);
3735
+ }
3736
+ function hasSpace$1(entity, goodMass, quantity) {
3737
+ const additional = goodMass.multiplying(quantity);
3738
+ return availableCapacity$1(entity).gte(additional);
3739
+ }
3740
+ function hasSpaceForMass(capacity, currentMass, additionalMass) {
3741
+ return UInt64.from(currentMass).adding(additionalMass).lte(capacity);
3742
+ }
3743
+ function isFull$1(entity) {
3744
+ return UInt64.from(entity.cargomass).gte(entity.capacity);
3745
+ }
3746
+ function isFullFromMass(capacity, cargoMass) {
3747
+ return UInt64.from(cargoMass).gte(capacity);
3156
3748
  }
3157
3749
 
3158
- function hasSchedule(entity) {
3750
+ function hasSchedule$1(entity) {
3159
3751
  return !!entity.schedule && entity.schedule.tasks.length > 0;
3160
3752
  }
3161
3753
  function isIdle(entity) {
3162
- return !hasSchedule(entity);
3754
+ return !hasSchedule$1(entity);
3163
3755
  }
3164
3756
  function getTasks(entity) {
3165
3757
  return entity.schedule?.tasks || [];
@@ -3184,7 +3776,7 @@ function scheduleRemaining(entity, now) {
3184
3776
  return Math.max(0, duration - elapsed);
3185
3777
  }
3186
3778
  function scheduleComplete(entity, now) {
3187
- return hasSchedule(entity) && scheduleRemaining(entity, now) === 0;
3779
+ return hasSchedule$1(entity) && scheduleRemaining(entity, now) === 0;
3188
3780
  }
3189
3781
  function currentTaskIndex(entity, now) {
3190
3782
  if (!entity.schedule || entity.schedule.tasks.length === 0)
@@ -3267,14 +3859,32 @@ function currentTaskProgress(entity, now) {
3267
3859
  function scheduleProgress(entity, now) {
3268
3860
  const duration = scheduleDuration(entity);
3269
3861
  if (duration === 0)
3270
- return hasSchedule(entity) ? 1 : 0;
3862
+ return hasSchedule$1(entity) ? 1 : 0;
3271
3863
  const elapsed = scheduleElapsed(entity, now);
3272
3864
  return Math.min(1, elapsed / duration);
3273
3865
  }
3866
+ function isTaskType(entity, taskType, now) {
3867
+ return currentTaskType(entity, now) === taskType;
3868
+ }
3869
+ function isInFlight(entity, now) {
3870
+ return isTaskType(entity, TaskType.TRAVEL, now);
3871
+ }
3872
+ function isRecharging(entity, now) {
3873
+ return isTaskType(entity, TaskType.RECHARGE, now);
3874
+ }
3875
+ function isLoading(entity, now) {
3876
+ return isTaskType(entity, TaskType.LOAD, now);
3877
+ }
3878
+ function isUnloading(entity, now) {
3879
+ return isTaskType(entity, TaskType.UNLOAD, now);
3880
+ }
3881
+ function isExtracting(entity, now) {
3882
+ return isTaskType(entity, TaskType.EXTRACT, now);
3883
+ }
3274
3884
 
3275
3885
  var schedule = /*#__PURE__*/Object.freeze({
3276
3886
  __proto__: null,
3277
- hasSchedule: hasSchedule,
3887
+ hasSchedule: hasSchedule$1,
3278
3888
  isIdle: isIdle,
3279
3889
  getTasks: getTasks,
3280
3890
  scheduleDuration: scheduleDuration,
@@ -3290,353 +3900,660 @@ var schedule = /*#__PURE__*/Object.freeze({
3290
3900
  isTaskComplete: isTaskComplete,
3291
3901
  isTaskInProgress: isTaskInProgress,
3292
3902
  currentTaskProgress: currentTaskProgress,
3293
- scheduleProgress: scheduleProgress
3903
+ scheduleProgress: scheduleProgress,
3904
+ isTaskType: isTaskType,
3905
+ isInFlight: isInFlight,
3906
+ isRecharging: isRecharging,
3907
+ isLoading: isLoading,
3908
+ isUnloading: isUnloading,
3909
+ isExtracting: isExtracting
3294
3910
  });
3295
3911
 
3296
- class EntityInventory extends Types.cargo_item {
3297
- get good() {
3298
- if (!this._good) {
3299
- this._good = getGood(this.good_id);
3300
- }
3301
- return this._good;
3302
- }
3303
- get name() {
3304
- return this.good.name;
3305
- }
3306
- get unitMass() {
3307
- return this.good.mass;
3308
- }
3309
- get totalMass() {
3310
- return UInt64.from(this.unitMass).multiplying(this.quantity);
3311
- }
3312
- get totalCost() {
3313
- return this.unit_cost.multiplying(this.quantity);
3314
- }
3315
- get hasCargo() {
3316
- return UInt32.from(this.quantity).gt(UInt32.from(0));
3317
- }
3318
- get isEmpty() {
3319
- return UInt32.from(this.quantity).equals(UInt32.from(0));
3320
- }
3912
+ function getHullMass(entity) {
3913
+ return UInt32.from(entity.hullmass ?? 0);
3321
3914
  }
3322
-
3323
- class Ship extends Types.entity_info {
3324
- static fromState(state) {
3325
- const entityInfo = Types.entity_info.from({
3326
- type: Name.from('ship'),
3327
- id: UInt64.from(state.id),
3328
- owner: Name.from(state.owner),
3329
- entity_name: state.name,
3330
- location: Types.coordinates.from(state.location),
3331
- mass: UInt32.from(state.mass),
3332
- capacity: UInt32.from(state.capacity),
3333
- energy: UInt16.from(state.energy),
3334
- cargomass: UInt32.from(0),
3335
- cargo: state.cargo || [],
3336
- is_idle: !state.schedule,
3337
- current_task_elapsed: UInt32.from(0),
3338
- current_task_remaining: UInt32.from(0),
3339
- pending_tasks: [],
3340
- engines: state.engines,
3341
- generator: state.generator,
3342
- loaders: state.loaders,
3343
- schedule: state.schedule,
3344
- });
3345
- return new Ship(entityInfo);
3346
- }
3347
- get name() {
3348
- return this.entity_name;
3349
- }
3350
- get inventory() {
3351
- if (!this._inventory) {
3352
- this._inventory = this.cargo.map((item) => new EntityInventory(item));
3353
- }
3354
- return this._inventory;
3355
- }
3356
- get maxDistance() {
3357
- if (!this.generator || !this.engines)
3358
- return UInt32.from(0);
3359
- return UInt32.from(this.generator.capacity)
3360
- .dividing(this.engines.drain)
3361
- .multiplying(PRECISION);
3362
- }
3363
- get hasSchedule() {
3364
- return hasSchedule(this);
3365
- }
3366
- get isIdle() {
3367
- return this.is_idle;
3368
- }
3369
- get tasks() {
3370
- return getTasks(this);
3371
- }
3372
- scheduleDuration() {
3373
- return scheduleDuration(this);
3374
- }
3375
- scheduleElapsed(now) {
3376
- return scheduleElapsed(this, now);
3377
- }
3378
- scheduleRemaining(now) {
3379
- return scheduleRemaining(this, now);
3380
- }
3381
- scheduleComplete(now) {
3382
- return scheduleComplete(this, now);
3383
- }
3384
- currentTaskIndex(now) {
3385
- return currentTaskIndex(this, now);
3386
- }
3387
- currentTask(now) {
3388
- return currentTask(this, now);
3389
- }
3390
- currentTaskType(now) {
3391
- return currentTaskType(this, now);
3392
- }
3393
- getTaskStartTime(index) {
3394
- return getTaskStartTime(this, index);
3395
- }
3396
- getTaskElapsed(index, now) {
3397
- return getTaskElapsed(this, index, now);
3398
- }
3399
- getTaskRemaining(index, now) {
3400
- return getTaskRemaining(this, index, now);
3401
- }
3402
- isTaskComplete(index, now) {
3403
- return isTaskComplete(this, index, now);
3404
- }
3405
- isTaskInProgress(index, now) {
3406
- return isTaskInProgress(this, index, now);
3407
- }
3408
- currentTaskProgress(now) {
3409
- return currentTaskProgress(this, now);
3410
- }
3411
- scheduleProgress(now) {
3412
- return scheduleProgress(this, now);
3413
- }
3414
- getFlightOrigin(flightTaskIndex) {
3415
- if (!this.schedule)
3416
- return this.location;
3417
- let origin = this.location;
3418
- for (let i = 0; i < flightTaskIndex && i < this.schedule.tasks.length; i++) {
3419
- const task = this.schedule.tasks[i];
3420
- if (task.type.equals(TaskType.FLIGHT) && task.location) {
3421
- origin = task.location;
3915
+ function createProjectedEntity(entity) {
3916
+ const cargoMass = calcCargoMass(entity);
3917
+ const shipMass = getHullMass(entity);
3918
+ const loaders = entity.loaders;
3919
+ const engines = entity.engines;
3920
+ const generator = entity.generator;
3921
+ const trade = entity.trade;
3922
+ const capacity = entity.capacity;
3923
+ const projected = {
3924
+ location: Coordinates.from(entity.coordinates),
3925
+ energy: UInt16.from(entity.energy ?? 0),
3926
+ cargoMass,
3927
+ shipMass,
3928
+ capacity: capacity ? UInt64.from(capacity) : undefined,
3929
+ engines,
3930
+ generator,
3931
+ loaders,
3932
+ trade,
3933
+ get totalMass() {
3934
+ let mass = UInt64.from(this.shipMass).adding(this.cargoMass);
3935
+ if (this.loaders) {
3936
+ mass = mass.adding(this.loaders.mass.multiplying(this.loaders.quantity));
3422
3937
  }
3423
- }
3424
- return origin;
3938
+ return mass;
3939
+ },
3940
+ hasMovement() {
3941
+ return capsHasMovement(this.capabilities());
3942
+ },
3943
+ hasStorage() {
3944
+ return capsHasStorage(this.capabilities());
3945
+ },
3946
+ hasLoaders() {
3947
+ return capsHasLoaders(this.capabilities());
3948
+ },
3949
+ hasTrade() {
3950
+ return this.trade !== undefined;
3951
+ },
3952
+ capabilities() {
3953
+ return {
3954
+ hullmass: this.shipMass,
3955
+ capacity: this.capacity ? UInt32.from(this.capacity) : undefined,
3956
+ engines: this.engines,
3957
+ generator: this.generator,
3958
+ loaders: this.loaders,
3959
+ trade: this.trade,
3960
+ };
3961
+ },
3962
+ state() {
3963
+ return {
3964
+ owner: entity.owner ?? Name.from(''),
3965
+ location: Types.coordinates.from(this.location),
3966
+ energy: this.energy,
3967
+ cargomass: UInt32.from(this.cargoMass),
3968
+ cargo: entity.cargo,
3969
+ };
3970
+ },
3971
+ };
3972
+ return projected;
3973
+ }
3974
+ function applyRechargeTask(projected, _task, options) {
3975
+ if (!projected.generator)
3976
+ return;
3977
+ if (options.complete) {
3978
+ projected.energy = UInt16.from(projected.generator.capacity);
3425
3979
  }
3426
- destinationLocation() {
3427
- if (!this.schedule)
3428
- return undefined;
3429
- for (let i = this.schedule.tasks.length - 1; i >= 0; i--) {
3430
- const task = this.schedule.tasks[i];
3431
- if (task.type.equals(TaskType.FLIGHT) && task.location) {
3432
- return task.location;
3433
- }
3434
- }
3435
- return undefined;
3980
+ else if (options.progress !== undefined) {
3981
+ const capacity = Number(projected.generator.capacity);
3982
+ const currentEnergy = Number(projected.energy);
3983
+ const rechargeAmount = (capacity - currentEnergy) * options.progress;
3984
+ projected.energy = UInt16.from(Math.min(capacity, currentEnergy + rechargeAmount));
3436
3985
  }
3437
- positionAt(now) {
3438
- if (!this.schedule || this.schedule.tasks.length === 0) {
3439
- return this.location;
3440
- }
3441
- const taskIndex = this.currentTaskIndex(now);
3442
- if (taskIndex < 0)
3443
- return this.location;
3444
- const task = this.schedule.tasks[taskIndex];
3445
- if (!task.type.equals(TaskType.FLIGHT) || !task.location) {
3446
- return this.getFlightOrigin(taskIndex);
3447
- }
3448
- const origin = this.getFlightOrigin(taskIndex);
3449
- const destination = task.location;
3450
- const progress = this.currentTaskProgress(now);
3451
- const interpolated = lerp(origin, destination, progress);
3452
- return Coordinates.from({
3986
+ }
3987
+ function applyFlightTask(projected, task, options) {
3988
+ if (!task.coordinates || !projected.engines)
3989
+ return;
3990
+ const origin = projected.location;
3991
+ const destination = Coordinates.from(task.coordinates);
3992
+ const distance = distanceBetweenCoordinates(origin, task.coordinates);
3993
+ const energyUsage = distance.dividing(PRECISION).multiplying(projected.engines.drain);
3994
+ if (options.complete) {
3995
+ projected.energy = projected.energy.gt(energyUsage)
3996
+ ? UInt16.from(projected.energy.subtracting(energyUsage))
3997
+ : UInt16.from(0);
3998
+ projected.location = destination;
3999
+ }
4000
+ else if (options.progress !== undefined) {
4001
+ const interpolated = lerp(origin, destination, options.progress);
4002
+ projected.location = Coordinates.from({
3453
4003
  x: Math.round(interpolated.x),
3454
4004
  y: Math.round(interpolated.y),
3455
4005
  });
4006
+ const partialEnergy = UInt64.from(Math.floor(Number(energyUsage) * options.progress));
4007
+ projected.energy = projected.energy.gt(partialEnergy)
4008
+ ? UInt16.from(projected.energy.subtracting(partialEnergy))
4009
+ : UInt16.from(0);
3456
4010
  }
3457
- isInFlight(now) {
3458
- const taskType = this.currentTaskType(now);
3459
- return taskType === TaskType.FLIGHT;
3460
- }
3461
- isRecharging(now) {
3462
- const taskType = this.currentTaskType(now);
3463
- return taskType === TaskType.RECHARGE;
4011
+ }
4012
+ function getItemMass(item_id) {
4013
+ const item = getItem(item_id);
4014
+ return item.mass;
4015
+ }
4016
+ function applyLoadTask(projected, task) {
4017
+ for (const item of task.cargo) {
4018
+ const good_mass = getItemMass(item.item_id);
4019
+ projected.cargoMass = projected.cargoMass.adding(good_mass.multiplying(item.quantity));
3464
4020
  }
3465
- isLoading(now) {
3466
- const taskType = this.currentTaskType(now);
3467
- return taskType === TaskType.LOAD;
4021
+ }
4022
+ function applyUnloadTask(projected, task) {
4023
+ for (const item of task.cargo) {
4024
+ const good_mass = getItemMass(item.item_id);
4025
+ const cargoMass = good_mass.multiplying(item.quantity);
4026
+ projected.cargoMass = projected.cargoMass.gt(cargoMass)
4027
+ ? projected.cargoMass.subtracting(cargoMass)
4028
+ : UInt64.from(0);
3468
4029
  }
3469
- isUnloading(now) {
3470
- const taskType = this.currentTaskType(now);
3471
- return taskType === TaskType.UNLOAD;
3472
- }
3473
- calcCargoMass() {
3474
- let mass = UInt64.from(0);
3475
- for (const item of this.cargo) {
3476
- const good = getGood(item.good_id);
3477
- mass = mass.adding(good.mass.multiplying(item.quantity));
3478
- }
3479
- return mass;
4030
+ }
4031
+ function applyExtractTask(projected, task, options) {
4032
+ if (!options.complete)
4033
+ return;
4034
+ if (task.energy_cost) {
4035
+ const energyCost = UInt16.from(task.energy_cost);
4036
+ projected.energy = projected.energy.gt(energyCost)
4037
+ ? UInt16.from(projected.energy.subtracting(energyCost))
4038
+ : UInt16.from(0);
3480
4039
  }
3481
- createProjectedEntity(cargoMass) {
3482
- const shipMass = UInt32.from(this.mass);
3483
- const loaders = this.loaders;
3484
- return {
3485
- location: Coordinates.from(this.location),
3486
- energy: UInt16.from(this.energy),
3487
- cargoMass,
3488
- shipMass,
3489
- engines: this.engines,
3490
- generator: this.generator,
3491
- loaders,
3492
- get totalMass() {
3493
- let mass = UInt64.from(this.shipMass).adding(this.cargoMass);
3494
- if (this.loaders) {
3495
- mass = mass.adding(this.loaders.mass.multiplying(this.loaders.quantity));
3496
- }
3497
- return mass;
3498
- },
3499
- };
4040
+ for (const item of task.cargo) {
4041
+ const good_mass = getItemMass(item.item_id);
4042
+ projected.cargoMass = projected.cargoMass.adding(good_mass.multiplying(item.quantity));
3500
4043
  }
3501
- project() {
3502
- const cargoMass = this.calcCargoMass();
3503
- const projected = this.createProjectedEntity(cargoMass);
3504
- if (!this.schedule) {
3505
- return projected;
3506
- }
3507
- for (const task of this.schedule.tasks) {
3508
- switch (task.type.toNumber()) {
3509
- case TaskType.RECHARGE:
3510
- if (projected.generator) {
3511
- projected.energy = UInt16.from(projected.generator.capacity);
3512
- }
3513
- break;
3514
- case TaskType.FLIGHT: {
3515
- if (task.location) {
3516
- const distance = distanceBetweenCoordinates(projected.location, task.location);
3517
- if (projected.engines) {
3518
- const energyUsage = distance
3519
- .dividing(PRECISION)
3520
- .multiplying(projected.engines.drain);
3521
- projected.energy = projected.energy.gt(energyUsage)
3522
- ? UInt16.from(projected.energy.subtracting(energyUsage))
3523
- : UInt16.from(0);
3524
- }
3525
- projected.location = Coordinates.from(task.location);
3526
- }
3527
- break;
3528
- }
3529
- case TaskType.LOAD:
3530
- for (const item of task.cargo) {
3531
- const good = getGood(item.good_id);
3532
- projected.cargoMass = projected.cargoMass.adding(good.mass.multiplying(item.quantity));
3533
- }
3534
- break;
3535
- case TaskType.UNLOAD:
3536
- for (const item of task.cargo) {
3537
- const good = getGood(item.good_id);
3538
- const cargoMass = good.mass.multiplying(item.quantity);
3539
- projected.cargoMass = projected.cargoMass.gt(cargoMass)
3540
- ? projected.cargoMass.subtracting(cargoMass)
3541
- : UInt64.from(0);
3542
- }
3543
- break;
3544
- }
4044
+ }
4045
+ function projectEntity(entity) {
4046
+ const projected = createProjectedEntity(entity);
4047
+ if (!entity.schedule) {
4048
+ return projected;
4049
+ }
4050
+ for (const task of entity.schedule.tasks) {
4051
+ switch (task.type.toNumber()) {
4052
+ case TaskType.RECHARGE:
4053
+ applyRechargeTask(projected, task, { complete: true });
4054
+ break;
4055
+ case TaskType.TRAVEL:
4056
+ applyFlightTask(projected, task, { complete: true });
4057
+ break;
4058
+ case TaskType.LOAD:
4059
+ applyLoadTask(projected, task);
4060
+ break;
4061
+ case TaskType.UNLOAD:
4062
+ applyUnloadTask(projected, task);
4063
+ break;
4064
+ case TaskType.EXTRACT:
4065
+ applyExtractTask(projected, task, { complete: true });
4066
+ break;
3545
4067
  }
4068
+ }
4069
+ return projected;
4070
+ }
4071
+ function projectEntityAt(entity, now) {
4072
+ const projected = createProjectedEntity(entity);
4073
+ if (!entity.schedule || entity.schedule.tasks.length === 0) {
3546
4074
  return projected;
3547
4075
  }
3548
- projectAt(now) {
3549
- const cargoMass = this.calcCargoMass();
3550
- const projected = this.createProjectedEntity(cargoMass);
3551
- if (!this.schedule || this.schedule.tasks.length === 0) {
3552
- return projected;
4076
+ for (let i = 0; i < entity.schedule.tasks.length; i++) {
4077
+ const task = entity.schedule.tasks[i];
4078
+ const taskComplete = isTaskComplete(entity, i, now);
4079
+ const taskInProgress = isTaskInProgress(entity, i, now);
4080
+ if (!taskComplete && !taskInProgress) {
4081
+ break;
3553
4082
  }
3554
- for (let i = 0; i < this.schedule.tasks.length; i++) {
3555
- const task = this.schedule.tasks[i];
3556
- const taskComplete = this.isTaskComplete(i, now);
3557
- const taskInProgress = this.isTaskInProgress(i, now);
3558
- if (!taskComplete && !taskInProgress) {
4083
+ const progress = taskInProgress
4084
+ ? getTaskElapsed(entity, i, now) / task.duration.toNumber()
4085
+ : undefined;
4086
+ switch (task.type.toNumber()) {
4087
+ case TaskType.RECHARGE:
4088
+ applyRechargeTask(projected, task, { complete: taskComplete, progress });
3559
4089
  break;
3560
- }
3561
- switch (task.type.toNumber()) {
3562
- case TaskType.RECHARGE:
3563
- if (projected.generator) {
3564
- if (taskComplete) {
3565
- projected.energy = UInt16.from(projected.generator.capacity);
3566
- }
3567
- else if (taskInProgress) {
3568
- const progress = this.getTaskElapsed(i, now) / task.duration.toNumber();
3569
- const capacity = Number(projected.generator.capacity);
3570
- const currentEnergy = Number(projected.energy);
3571
- const rechargeAmount = (capacity - currentEnergy) * progress;
3572
- projected.energy = UInt16.from(Math.min(capacity, currentEnergy + rechargeAmount));
3573
- }
3574
- }
3575
- break;
3576
- case TaskType.FLIGHT: {
3577
- if (task.location && projected.engines) {
3578
- const origin = projected.location;
3579
- const destination = Coordinates.from(task.location);
3580
- const distance = distanceBetweenCoordinates(origin, task.location);
3581
- const energyUsage = distance
3582
- .dividing(PRECISION)
3583
- .multiplying(projected.engines.drain);
3584
- if (taskComplete) {
3585
- projected.energy = projected.energy.gt(energyUsage)
3586
- ? UInt16.from(projected.energy.subtracting(energyUsage))
3587
- : UInt16.from(0);
3588
- projected.location = destination;
3589
- }
3590
- else if (taskInProgress) {
3591
- const progress = this.getTaskElapsed(i, now) / task.duration.toNumber();
3592
- const interpolated = lerp(origin, destination, progress);
3593
- projected.location = Coordinates.from({
3594
- x: Math.round(interpolated.x),
3595
- y: Math.round(interpolated.y),
3596
- });
3597
- const partialEnergy = UInt64.from(Math.floor(Number(energyUsage) * progress));
3598
- projected.energy = projected.energy.gt(partialEnergy)
3599
- ? UInt16.from(projected.energy.subtracting(partialEnergy))
3600
- : UInt16.from(0);
3601
- }
3602
- }
3603
- break;
4090
+ case TaskType.TRAVEL:
4091
+ applyFlightTask(projected, task, { complete: taskComplete, progress });
4092
+ break;
4093
+ case TaskType.LOAD:
4094
+ if (taskComplete) {
4095
+ applyLoadTask(projected, task);
3604
4096
  }
3605
- case TaskType.LOAD:
3606
- if (taskComplete) {
3607
- for (const item of task.cargo) {
3608
- const good = getGood(item.good_id);
3609
- projected.cargoMass = projected.cargoMass.adding(good.mass.multiplying(item.quantity));
3610
- }
3611
- }
3612
- break;
3613
- case TaskType.UNLOAD:
3614
- if (taskComplete) {
3615
- for (const item of task.cargo) {
3616
- const good = getGood(item.good_id);
3617
- const cargoMass = good.mass.multiplying(item.quantity);
3618
- projected.cargoMass = projected.cargoMass.gt(cargoMass)
3619
- ? projected.cargoMass.subtracting(cargoMass)
3620
- : UInt64.from(0);
3621
- }
3622
- }
3623
- break;
3624
- }
4097
+ break;
4098
+ case TaskType.UNLOAD:
4099
+ if (taskComplete) {
4100
+ applyUnloadTask(projected, task);
4101
+ }
4102
+ break;
4103
+ case TaskType.EXTRACT:
4104
+ if (taskComplete) {
4105
+ applyExtractTask(projected, task, { complete: true });
4106
+ }
4107
+ break;
3625
4108
  }
3626
- return projected;
3627
4109
  }
3628
- get currentLocation() {
3629
- return this.location;
4110
+ return projected;
4111
+ }
4112
+
4113
+ class Location {
4114
+ constructor(coordinates) {
4115
+ this.coordinates = Coordinates.from(coordinates);
4116
+ }
4117
+ static from(coordinates) {
4118
+ return new Location(Coordinates.from(coordinates));
4119
+ }
4120
+ hasSystemAt(gameSeed) {
4121
+ const seed = Checksum256.from(gameSeed);
4122
+ if (this._hasSystem === undefined || !this._gameSeed?.equals(seed)) {
4123
+ this._gameSeed = seed;
4124
+ this._hasSystem = hasSystem(seed, this.coordinates);
4125
+ }
4126
+ return this._hasSystem;
4127
+ }
4128
+ getLocationTypeAt(gameSeed) {
4129
+ return getLocationType(gameSeed, this.coordinates);
4130
+ }
4131
+ isExtractableAt(gameSeed) {
4132
+ return isExtractableLocation(this.getLocationTypeAt(gameSeed));
4133
+ }
4134
+ setMarketPrices(prices) {
4135
+ this._marketPrices = prices;
4136
+ }
4137
+ get marketPrices() {
4138
+ return this._marketPrices;
4139
+ }
4140
+ getPrice(goodId) {
4141
+ if (!this._marketPrices)
4142
+ return undefined;
4143
+ return this._marketPrices.find((p) => p.id.equals(goodId));
4144
+ }
4145
+ findNearby(gameSeed, maxDistance = 20) {
4146
+ return findNearbyPlanets(Checksum256.from(gameSeed), this.coordinates, maxDistance);
4147
+ }
4148
+ equals(other) {
4149
+ const otherCoords = other instanceof Location ? other.coordinates : Coordinates.from(other);
4150
+ return this.coordinates.equals(otherCoords);
4151
+ }
4152
+ setLocationRows(rows, epoch) {
4153
+ this._locationRows = rows;
4154
+ this._epoch = epoch;
4155
+ }
4156
+ get locationRows() {
4157
+ return this._locationRows;
4158
+ }
4159
+ getSupply(goodId) {
4160
+ if (!this._locationRows)
4161
+ return undefined;
4162
+ const row = this._locationRows.find((r) => r.item_id.equals(goodId) && this._epoch && r.epoch.equals(this._epoch));
4163
+ return row ? row.supply : undefined;
4164
+ }
4165
+ get availableGoods() {
4166
+ if (!this._locationRows)
4167
+ return undefined;
4168
+ return this._locationRows.filter((r) => this._epoch && r.epoch.equals(this._epoch) && r.supply.gt(UInt16.from(0)));
4169
+ }
4170
+ hasGood(goodId) {
4171
+ const supply = this.getSupply(goodId);
4172
+ return supply !== undefined && supply.gt(UInt16.from(0));
4173
+ }
4174
+ get epoch() {
4175
+ return this._epoch;
4176
+ }
4177
+ get hasCachedData() {
4178
+ return this._marketPrices !== undefined || this._locationRows !== undefined;
4179
+ }
4180
+ get hasSupplyData() {
4181
+ return this._locationRows !== undefined;
4182
+ }
4183
+ clearCache() {
4184
+ this._marketPrices = undefined;
4185
+ this._locationRows = undefined;
4186
+ this._epoch = undefined;
4187
+ }
4188
+ withUpdatedSupply(goodId, quantityDelta) {
4189
+ const newLocation = Location.from(this.coordinates);
4190
+ if (this._marketPrices) {
4191
+ newLocation._marketPrices = this._marketPrices.map((price) => {
4192
+ if (price.id.equals(goodId)) {
4193
+ const currentSupply = UInt16.from(price.supply);
4194
+ const delta = UInt16.from(Math.abs(quantityDelta));
4195
+ const newSupply = quantityDelta < 0
4196
+ ? currentSupply.gte(delta)
4197
+ ? currentSupply.subtracting(delta)
4198
+ : UInt16.from(0)
4199
+ : currentSupply.adding(quantityDelta);
4200
+ return ItemPrice.from({
4201
+ id: price.id,
4202
+ item: price.item,
4203
+ price: price.price,
4204
+ supply: newSupply,
4205
+ });
4206
+ }
4207
+ return price;
4208
+ });
4209
+ }
4210
+ if (this._locationRows && this._epoch) {
4211
+ newLocation._locationRows = this._locationRows.map((row) => {
4212
+ if (row.item_id.equals(goodId) && row.epoch.equals(this._epoch)) {
4213
+ const currentSupply = UInt16.from(row.supply);
4214
+ const delta = UInt16.from(Math.abs(quantityDelta));
4215
+ const newSupply = quantityDelta < 0
4216
+ ? currentSupply.gte(delta)
4217
+ ? currentSupply.subtracting(delta)
4218
+ : UInt16.from(0)
4219
+ : currentSupply.adding(quantityDelta);
4220
+ return Types.supply_row.from({
4221
+ id: row.id,
4222
+ coordinates: row.coordinates,
4223
+ epoch: row.epoch,
4224
+ item_id: row.item_id,
4225
+ supply: newSupply,
4226
+ });
4227
+ }
4228
+ return row;
4229
+ });
4230
+ newLocation._epoch = this._epoch;
4231
+ }
4232
+ newLocation._gameSeed = this._gameSeed;
4233
+ newLocation._hasSystem = this._hasSystem;
4234
+ return newLocation;
4235
+ }
4236
+ }
4237
+ function toLocation(coords) {
4238
+ if (coords instanceof Location) {
4239
+ return coords;
4240
+ }
4241
+ return Location.from(coords);
4242
+ }
4243
+
4244
+ class ScheduleAccessor {
4245
+ constructor(entity) {
4246
+ this.entity = entity;
4247
+ }
4248
+ get hasSchedule() {
4249
+ return hasSchedule$1(this.entity);
4250
+ }
4251
+ get isIdle() {
4252
+ return isIdle(this.entity);
4253
+ }
4254
+ get tasks() {
4255
+ return getTasks(this.entity);
4256
+ }
4257
+ duration() {
4258
+ return scheduleDuration(this.entity);
4259
+ }
4260
+ elapsed(now) {
4261
+ return scheduleElapsed(this.entity, now);
4262
+ }
4263
+ remaining(now) {
4264
+ return scheduleRemaining(this.entity, now);
4265
+ }
4266
+ complete(now) {
4267
+ return scheduleComplete(this.entity, now);
4268
+ }
4269
+ currentTaskIndex(now) {
4270
+ return currentTaskIndex(this.entity, now);
4271
+ }
4272
+ currentTask(now) {
4273
+ return currentTask(this.entity, now);
4274
+ }
4275
+ currentTaskType(now) {
4276
+ return currentTaskType(this.entity, now);
4277
+ }
4278
+ taskStartTime(index) {
4279
+ return getTaskStartTime(this.entity, index);
4280
+ }
4281
+ taskElapsed(index, now) {
4282
+ return getTaskElapsed(this.entity, index, now);
4283
+ }
4284
+ taskRemaining(index, now) {
4285
+ return getTaskRemaining(this.entity, index, now);
4286
+ }
4287
+ taskComplete(index, now) {
4288
+ return isTaskComplete(this.entity, index, now);
4289
+ }
4290
+ taskInProgress(index, now) {
4291
+ return isTaskInProgress(this.entity, index, now);
4292
+ }
4293
+ currentTaskProgress(now) {
4294
+ return currentTaskProgress(this.entity, now);
4295
+ }
4296
+ progress(now) {
4297
+ return scheduleProgress(this.entity, now);
4298
+ }
4299
+ }
4300
+ function createScheduleAccessor(entity) {
4301
+ return new ScheduleAccessor(entity);
4302
+ }
4303
+
4304
+ class EntityInventory extends Types.cargo_item {
4305
+ get item() {
4306
+ if (!this._item) {
4307
+ this._item = getItem(this.item_id);
4308
+ }
4309
+ return this._item;
4310
+ }
4311
+ get good() {
4312
+ return this.item;
4313
+ }
4314
+ get name() {
4315
+ return this.item.name;
4316
+ }
4317
+ get unitMass() {
4318
+ return this.item.mass;
4319
+ }
4320
+ get totalMass() {
4321
+ return UInt64.from(this.unitMass).multiplying(this.quantity);
4322
+ }
4323
+ get totalCost() {
4324
+ return this.unit_cost.multiplying(this.quantity);
4325
+ }
4326
+ get hasCargo() {
4327
+ return UInt32.from(this.quantity).gt(UInt32.from(0));
4328
+ }
4329
+ get isEmpty() {
4330
+ return UInt32.from(this.quantity).equals(UInt32.from(0));
4331
+ }
4332
+ }
4333
+
4334
+ class InventoryAccessor {
4335
+ constructor(entity) {
4336
+ this.entity = entity;
4337
+ }
4338
+ get items() {
4339
+ if (!this._items) {
4340
+ this._items = this.entity.cargo.map((item) => new EntityInventory(item));
4341
+ }
4342
+ return this._items;
4343
+ }
4344
+ get totalMass() {
4345
+ return this.items.reduce((sum, c) => sum.adding(c.totalMass), UInt64.from(0));
4346
+ }
4347
+ get totalValue() {
4348
+ return this.items.reduce((sum, c) => sum.adding(c.totalCost), UInt64.from(0));
4349
+ }
4350
+ forItem(goodId) {
4351
+ return this.items.find((c) => c.item_id.equals(goodId));
4352
+ }
4353
+ get sellable() {
4354
+ return this.items.filter((c) => c.hasCargo);
4355
+ }
4356
+ get hasSellable() {
4357
+ return this.items.some((c) => c.hasCargo);
4358
+ }
4359
+ get sellableCount() {
4360
+ return this.items.filter((c) => c.hasCargo).length;
4361
+ }
4362
+ }
4363
+ function createInventoryAccessor(entity) {
4364
+ return new InventoryAccessor(entity);
4365
+ }
4366
+
4367
+ function maxTravelDistance(entity) {
4368
+ return UInt32.from(entity.generator.capacity)
4369
+ .dividing(entity.engines.drain)
4370
+ .multiplying(PRECISION);
4371
+ }
4372
+ function calcEnergyUsage(entity, distance) {
4373
+ return distance.dividing(PRECISION).multiplying(entity.engines.drain);
4374
+ }
4375
+ function hasEnergyForDistance(entity, distance) {
4376
+ const usage = calcEnergyUsage(entity, distance);
4377
+ return UInt64.from(entity.energy).gte(usage);
4378
+ }
4379
+ function energyPercent(entity) {
4380
+ return (Number(entity.energy) / Number(entity.generator.capacity)) * 100;
4381
+ }
4382
+ function needsRecharge(entity) {
4383
+ return UInt64.from(entity.energy).lt(entity.generator.capacity);
4384
+ }
4385
+
4386
+ function totalCargoMass(cargo) {
4387
+ return cargo.reduce((sum, c) => {
4388
+ return sum.adding(c.totalMass);
4389
+ }, UInt64.from(0));
4390
+ }
4391
+ function cargoValue(cargo) {
4392
+ return cargo.reduce((sum, c) => {
4393
+ return sum.adding(c.totalCost);
4394
+ }, UInt64.from(0));
4395
+ }
4396
+ function getCargoForItem(cargo, goodId) {
4397
+ return cargo.find((c) => c.item_id.equals(goodId));
4398
+ }
4399
+ function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
4400
+ const additionalMass = goodMass.multiplying(quantity);
4401
+ const totalMass = currentMass.adding(additionalMass);
4402
+ return totalMass.lte(maxCapacity);
4403
+ }
4404
+ function availableCapacity(currentMass, maxCapacity) {
4405
+ if (currentMass.gte(maxCapacity)) {
4406
+ return UInt64.from(0);
4407
+ }
4408
+ return maxCapacity.subtracting(currentMass);
4409
+ }
4410
+ function isFull(currentMass, maxCapacity) {
4411
+ return currentMass.gte(maxCapacity);
4412
+ }
4413
+ function calculateSaleValue(cargo, prices) {
4414
+ if (cargo.length === 0) {
4415
+ return { revenue: UInt64.from(0), profit: UInt64.from(0), cost: UInt64.from(0) };
4416
+ }
4417
+ let revenue = UInt64.from(0);
4418
+ let cost = UInt64.from(0);
4419
+ for (const item of cargo) {
4420
+ if (UInt32.from(item.quantity).equals(UInt32.from(0)))
4421
+ continue;
4422
+ const goodId = Number(item.item_id);
4423
+ const salePrice = prices.get(goodId);
4424
+ if (salePrice) {
4425
+ revenue = revenue.adding(salePrice.multiplying(item.quantity));
4426
+ }
4427
+ cost = cost.adding(item.unit_cost.multiplying(item.quantity));
4428
+ }
4429
+ const profit = revenue.gte(cost) ? revenue.subtracting(cost) : UInt64.from(0);
4430
+ return {
4431
+ revenue,
4432
+ profit,
4433
+ cost,
4434
+ };
4435
+ }
4436
+ function calculateSaleValueFromArray(cargo, prices) {
4437
+ const priceMap = new Map();
4438
+ prices.forEach((price, index) => {
4439
+ priceMap.set(index, price);
4440
+ });
4441
+ return calculateSaleValue(cargo, priceMap);
4442
+ }
4443
+ function afterSellItems(cargo, goodsToSell) {
4444
+ if (cargo.length === 0) {
4445
+ return [];
4446
+ }
4447
+ return cargo.map((item) => {
4448
+ const saleItem = goodsToSell.find((s) => Number(item.item_id) === s.goodId);
4449
+ if (!saleItem) {
4450
+ return new EntityInventory(item);
4451
+ }
4452
+ const currentQty = Number(item.quantity);
4453
+ const newQty = Math.max(0, currentQty - saleItem.quantity);
4454
+ return new EntityInventory(Types.cargo_item.from({
4455
+ item_id: item.item_id,
4456
+ quantity: UInt32.from(newQty),
4457
+ unit_cost: item.unit_cost,
4458
+ }));
4459
+ });
4460
+ }
4461
+ function afterSellAllItems(cargo) {
4462
+ if (cargo.length === 0) {
4463
+ return [];
4464
+ }
4465
+ return cargo.map((item) => new EntityInventory(Types.cargo_item.from({
4466
+ item_id: item.item_id,
4467
+ quantity: UInt32.from(0),
4468
+ unit_cost: item.unit_cost,
4469
+ })));
4470
+ }
4471
+
4472
+ var cargoUtils = /*#__PURE__*/Object.freeze({
4473
+ __proto__: null,
4474
+ totalCargoMass: totalCargoMass,
4475
+ cargoValue: cargoValue,
4476
+ getCargoForItem: getCargoForItem,
4477
+ hasSpace: hasSpace,
4478
+ availableCapacity: availableCapacity,
4479
+ isFull: isFull,
4480
+ calculateSaleValue: calculateSaleValue,
4481
+ calculateSaleValueFromArray: calculateSaleValueFromArray,
4482
+ afterSellItems: afterSellItems,
4483
+ afterSellAllItems: afterSellAllItems
4484
+ });
4485
+
4486
+ class Ship extends Types.entity_info {
4487
+ get name() {
4488
+ return this.entity_name;
4489
+ }
4490
+ get inv() {
4491
+ return (this._inv ?? (this._inv = new InventoryAccessor(this)));
4492
+ }
4493
+ get inventory() {
4494
+ return this.inv.items;
4495
+ }
4496
+ get sched() {
4497
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
4498
+ }
4499
+ get maxDistance() {
4500
+ if (!this.generator || !this.engines)
4501
+ return UInt32.from(0);
4502
+ return maxTravelDistance(this);
4503
+ }
4504
+ get isIdle() {
4505
+ return this.is_idle;
4506
+ }
4507
+ getFlightOrigin(flightTaskIndex) {
4508
+ return Coordinates.from(getFlightOrigin(this, flightTaskIndex));
4509
+ }
4510
+ destinationLocation() {
4511
+ const dest = getDestinationLocation(this);
4512
+ return dest ? Coordinates.from(dest) : undefined;
4513
+ }
4514
+ positionAt(now) {
4515
+ const taskIndex = this.sched.currentTaskIndex(now);
4516
+ const progress = this.sched.currentTaskProgress(now);
4517
+ return Coordinates.from(getPositionAt(this, taskIndex, progress));
4518
+ }
4519
+ isInFlight(now) {
4520
+ return isInFlight(this, now);
4521
+ }
4522
+ isRecharging(now) {
4523
+ return isRecharging(this, now);
4524
+ }
4525
+ isLoading(now) {
4526
+ return isLoading(this, now);
4527
+ }
4528
+ isUnloading(now) {
4529
+ return isUnloading(this, now);
4530
+ }
4531
+ isExtracting(now) {
4532
+ return isExtracting(this, now);
4533
+ }
4534
+ get hasExtractor() {
4535
+ return this.extractor !== undefined;
4536
+ }
4537
+ get hasWarp() {
4538
+ return this.warp !== undefined;
4539
+ }
4540
+ project() {
4541
+ return projectEntity(this);
4542
+ }
4543
+ projectAt(now) {
4544
+ return projectEntityAt(this, now);
4545
+ }
4546
+ get location() {
4547
+ return Location.from(this.coordinates);
3630
4548
  }
3631
4549
  get totalCargoMass() {
3632
- return this.inventory.reduce((sum, c) => sum.adding(c.totalMass), UInt64.from(0));
4550
+ return this.inv.totalMass;
3633
4551
  }
3634
4552
  get cargoValue() {
3635
- return this.inventory.reduce((sum, c) => sum.adding(c.totalCost), UInt64.from(0));
4553
+ return this.inv.totalValue;
3636
4554
  }
3637
4555
  get totalMass() {
3638
- const cargoMass = this.totalCargoMass;
3639
- let mass = UInt64.from(this.mass ?? 0).adding(cargoMass);
4556
+ let mass = UInt64.from(this.hullmass ?? 0).adding(this.totalCargoMass);
3640
4557
  if (this.loaders) {
3641
4558
  mass = mass.adding(UInt64.from(this.loaders.mass).multiplying(this.loaders.quantity));
3642
4559
  }
@@ -3646,263 +4563,146 @@ class Ship extends Types.entity_info {
3646
4563
  return UInt64.from(this.capacity);
3647
4564
  }
3648
4565
  hasSpace(goodMass, quantity) {
3649
- const additionalMass = goodMass.multiplying(quantity);
3650
- const newTotal = this.totalMass.adding(additionalMass);
3651
- return newTotal.lte(this.maxCapacity);
4566
+ return this.totalMass.adding(goodMass.multiplying(quantity)).lte(this.maxCapacity);
3652
4567
  }
3653
4568
  get availableCapacity() {
3654
- if (this.totalMass.gte(this.maxCapacity)) {
3655
- return UInt64.from(0);
3656
- }
3657
- return this.maxCapacity.subtracting(this.totalMass);
4569
+ return this.totalMass.gte(this.maxCapacity)
4570
+ ? UInt64.from(0)
4571
+ : this.maxCapacity.subtracting(this.totalMass);
3658
4572
  }
3659
- get locationObject() {
3660
- if (!this._location) {
3661
- this._location = Location.from(this.location);
3662
- }
3663
- return this._location;
3664
- }
3665
- setLocation(location) {
3666
- this._location = location;
3667
- }
3668
- getCargoForGood(goodId) {
3669
- return this.inventory.find((c) => c.good_id.equals(goodId));
4573
+ getCargoForItem(goodId) {
4574
+ return this.inv.forItem(goodId);
3670
4575
  }
3671
4576
  get sellableCargo() {
3672
- return this.inventory.filter((c) => c.hasCargo);
4577
+ return this.inv.sellable;
3673
4578
  }
3674
4579
  get hasSellableCargo() {
3675
- return this.inventory.some((c) => c.hasCargo);
4580
+ return this.inv.hasSellable;
3676
4581
  }
3677
4582
  get sellableGoodsCount() {
3678
- return this.inventory.filter((c) => c.hasCargo).length;
4583
+ return this.inv.sellableCount;
3679
4584
  }
3680
4585
  get isFull() {
3681
4586
  return this.totalMass.gte(this.maxCapacity);
3682
4587
  }
3683
4588
  get energyPercent() {
3684
- if (!this.generator)
4589
+ if (!this.generator || this.energy === undefined)
3685
4590
  return 0;
3686
- return (Number(this.energy ?? 0) / Number(this.generator.capacity)) * 100;
4591
+ return energyPercent(this);
3687
4592
  }
3688
4593
  get needsRecharge() {
3689
- if (!this.generator)
4594
+ if (!this.generator || this.energy === undefined)
3690
4595
  return false;
3691
- return UInt64.from(this.energy ?? 0).lt(this.generator.capacity);
4596
+ return needsRecharge(this);
3692
4597
  }
3693
4598
  hasEnergyFor(distance) {
3694
- if (!this.engines)
4599
+ if (!this.engines || !this.generator || this.energy === undefined)
3695
4600
  return false;
3696
- const energyNeeded = distance.dividing(PRECISION).multiplying(this.engines.drain);
3697
- return UInt64.from(this.energy ?? 0).gte(energyNeeded);
4601
+ return hasEnergyForDistance(this, distance);
3698
4602
  }
3699
4603
  calculateSaleValue(prices) {
3700
- if (this.cargo.length === 0) {
3701
- return { revenue: UInt64.from(0), profit: UInt64.from(0), cost: UInt64.from(0) };
3702
- }
3703
- let revenue = UInt64.from(0);
3704
- let cost = UInt64.from(0);
3705
- for (const item of this.cargo) {
3706
- if (UInt32.from(item.quantity).equals(UInt32.from(0)))
3707
- continue;
3708
- const goodId = Number(item.good_id);
3709
- const salePrice = prices.get(goodId);
3710
- if (salePrice) {
3711
- revenue = revenue.adding(salePrice.multiplying(item.quantity));
3712
- }
3713
- cost = cost.adding(item.unit_cost.multiplying(item.quantity));
3714
- }
3715
- const profit = revenue.gte(cost) ? revenue.subtracting(cost) : UInt64.from(0);
3716
- return {
3717
- revenue,
3718
- profit,
3719
- cost,
3720
- };
4604
+ return calculateSaleValue(this.cargo, prices);
3721
4605
  }
3722
4606
  calculateSaleValueFromArray(prices) {
3723
- const priceMap = new Map();
3724
- prices.forEach((price, index) => {
3725
- priceMap.set(index, price);
3726
- });
3727
- return this.calculateSaleValue(priceMap);
3728
- }
3729
- afterSellGoods(goodsToSell) {
3730
- if (this.cargo.length === 0) {
3731
- return [];
3732
- }
3733
- return this.cargo.map((item) => {
3734
- const saleItem = goodsToSell.find((s) => Number(item.good_id) === s.goodId);
3735
- if (!saleItem) {
3736
- return new EntityInventory(item);
3737
- }
3738
- const currentQty = Number(item.quantity);
3739
- const newQty = Math.max(0, currentQty - saleItem.quantity);
3740
- return new EntityInventory(Types.cargo_item.from({
3741
- good_id: item.good_id,
3742
- quantity: UInt32.from(newQty),
3743
- unit_cost: item.unit_cost,
3744
- }));
3745
- });
4607
+ return calculateSaleValueFromArray(this.cargo, prices);
3746
4608
  }
3747
- afterSellAllGoods() {
3748
- if (this.cargo.length === 0) {
3749
- return [];
3750
- }
3751
- return this.cargo.map((item) => new EntityInventory(Types.cargo_item.from({
3752
- good_id: item.good_id,
3753
- quantity: UInt32.from(0),
3754
- unit_cost: item.unit_cost,
3755
- })));
4609
+ afterSellItems(goodsToSell) {
4610
+ return afterSellItems(this.cargo, goodsToSell);
4611
+ }
4612
+ afterSellAllItems() {
4613
+ return afterSellAllItems(this.cargo);
3756
4614
  }
3757
4615
  }
3758
4616
 
3759
4617
  class Warehouse extends Types.entity_info {
3760
- static fromState(state) {
3761
- const entityInfo = Types.entity_info.from({
3762
- type: Name.from('warehouse'),
3763
- id: UInt64.from(state.id),
3764
- owner: Name.from(state.owner),
3765
- entity_name: state.name,
3766
- location: Types.coordinates.from(state.location),
3767
- capacity: UInt32.from(state.capacity),
3768
- cargomass: UInt32.from(0),
3769
- cargo: state.cargo || [],
3770
- loaders: state.loaders,
3771
- is_idle: !state.schedule,
3772
- current_task_elapsed: UInt32.from(0),
3773
- current_task_remaining: UInt32.from(0),
3774
- pending_tasks: [],
3775
- schedule: state.schedule,
3776
- mass: UInt32.from(0),
3777
- energy: 0,
3778
- engines: Types.movement_stats.from({
3779
- thrust: 0,
3780
- drain: 0,
3781
- maxmass: 0,
3782
- }),
3783
- generator: Types.energy_stats.from({
3784
- capacity: 0,
3785
- recharge: 0,
3786
- }),
3787
- });
3788
- return new Warehouse(entityInfo);
3789
- }
3790
4618
  get name() {
3791
4619
  return this.entity_name;
3792
4620
  }
4621
+ get inv() {
4622
+ return (this._inv ?? (this._inv = new InventoryAccessor(this)));
4623
+ }
3793
4624
  get inventory() {
3794
- if (!this._inventory) {
3795
- this._inventory = this.cargo.map((item) => new EntityInventory(item));
3796
- }
3797
- return this._inventory;
4625
+ return this.inv.items;
3798
4626
  }
3799
- get hasSchedule() {
3800
- return hasSchedule(this);
4627
+ get sched() {
4628
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
3801
4629
  }
3802
4630
  get isIdle() {
3803
4631
  return this.is_idle;
3804
4632
  }
3805
- get tasks() {
3806
- return getTasks(this);
3807
- }
3808
- scheduleDuration() {
3809
- return scheduleDuration(this);
4633
+ isLoading(now) {
4634
+ return isLoading(this, now);
3810
4635
  }
3811
- scheduleElapsed(now) {
3812
- return scheduleElapsed(this, now);
4636
+ isUnloading(now) {
4637
+ return isUnloading(this, now);
3813
4638
  }
3814
- scheduleRemaining(now) {
3815
- return scheduleRemaining(this, now);
4639
+ get location() {
4640
+ return Location.from(this.coordinates);
3816
4641
  }
3817
- scheduleComplete(now) {
3818
- return scheduleComplete(this, now);
4642
+ get totalCargoMass() {
4643
+ return this.inv.totalMass;
3819
4644
  }
3820
- currentTaskIndex(now) {
3821
- return currentTaskIndex(this, now);
4645
+ get cargoValue() {
4646
+ return this.inv.totalValue;
3822
4647
  }
3823
- currentTask(now) {
3824
- return currentTask(this, now);
4648
+ get maxCapacity() {
4649
+ return UInt64.from(this.capacity);
3825
4650
  }
3826
- currentTaskType(now) {
3827
- return currentTaskType(this, now);
4651
+ get availableCapacity() {
4652
+ const cargo = this.totalCargoMass;
4653
+ return cargo.gte(this.maxCapacity) ? UInt64.from(0) : this.maxCapacity.subtracting(cargo);
3828
4654
  }
3829
- getTaskStartTime(index) {
3830
- return getTaskStartTime(this, index);
4655
+ hasSpace(goodMass, quantity) {
4656
+ return this.totalCargoMass.adding(goodMass.multiplying(quantity)).lte(this.maxCapacity);
3831
4657
  }
3832
- getTaskElapsed(index, now) {
3833
- return getTaskElapsed(this, index, now);
4658
+ get isFull() {
4659
+ return this.totalCargoMass.gte(this.maxCapacity);
3834
4660
  }
3835
- getTaskRemaining(index, now) {
3836
- return getTaskRemaining(this, index, now);
4661
+ getCargoForItem(goodId) {
4662
+ return this.inv.forItem(goodId);
3837
4663
  }
3838
- isTaskComplete(index, now) {
3839
- return isTaskComplete(this, index, now);
4664
+ get orbitalAltitude() {
4665
+ return this.coordinates.z?.toNumber() || 0;
3840
4666
  }
3841
- isTaskInProgress(index, now) {
3842
- return isTaskInProgress(this, index, now);
4667
+ }
4668
+
4669
+ class Container extends Types.entity_info {
4670
+ get name() {
4671
+ return this.entity_name;
3843
4672
  }
3844
- currentTaskProgress(now) {
3845
- return currentTaskProgress(this, now);
4673
+ get sched() {
4674
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
3846
4675
  }
3847
- scheduleProgress(now) {
3848
- return scheduleProgress(this, now);
4676
+ get isIdle() {
4677
+ return this.is_idle;
3849
4678
  }
3850
4679
  isLoading(now) {
3851
- const taskType = this.currentTaskType(now);
3852
- return taskType === TaskType.LOAD;
4680
+ return isLoading(this, now);
3853
4681
  }
3854
4682
  isUnloading(now) {
3855
- const taskType = this.currentTaskType(now);
3856
- return taskType === TaskType.UNLOAD;
3857
- }
3858
- calcCargoMass() {
3859
- let mass = UInt64.from(0);
3860
- for (const item of this.cargo) {
3861
- const good = getGood(item.good_id);
3862
- mass = mass.adding(good.mass.multiplying(item.quantity));
3863
- }
3864
- return mass;
4683
+ return isUnloading(this, now);
3865
4684
  }
3866
- get currentLocation() {
3867
- return this.location;
4685
+ get location() {
4686
+ return Location.from(this.coordinates);
3868
4687
  }
3869
- get totalCargoMass() {
3870
- return this.inventory.reduce((sum, c) => sum.adding(c.totalMass), UInt64.from(0));
3871
- }
3872
- get cargoValue() {
3873
- return this.inventory.reduce((sum, c) => sum.adding(c.totalCost), UInt64.from(0));
4688
+ get totalMass() {
4689
+ return UInt64.from(this.hullmass ?? 0).adding(this.cargomass);
3874
4690
  }
3875
4691
  get maxCapacity() {
3876
4692
  return UInt64.from(this.capacity);
3877
4693
  }
3878
4694
  get availableCapacity() {
3879
- if (this.totalCargoMass.gte(this.maxCapacity)) {
3880
- return UInt64.from(0);
3881
- }
3882
- return this.maxCapacity.subtracting(this.totalCargoMass);
4695
+ const cargo = UInt64.from(this.cargomass);
4696
+ return cargo.gte(this.maxCapacity) ? UInt64.from(0) : this.maxCapacity.subtracting(cargo);
3883
4697
  }
3884
- hasSpace(goodMass, quantity) {
3885
- const additionalMass = goodMass.multiplying(quantity);
3886
- const newTotal = this.totalCargoMass.adding(additionalMass);
3887
- return newTotal.lte(this.maxCapacity);
4698
+ hasSpace(additionalMass) {
4699
+ return UInt64.from(this.cargomass).adding(additionalMass).lte(this.maxCapacity);
3888
4700
  }
3889
4701
  get isFull() {
3890
- return this.totalCargoMass.gte(this.maxCapacity);
3891
- }
3892
- get locationObject() {
3893
- if (!this._location) {
3894
- this._location = Location.from(this.location);
3895
- }
3896
- return this._location;
3897
- }
3898
- setLocation(location) {
3899
- this._location = location;
3900
- }
3901
- getCargoForGood(goodId) {
3902
- return this.inventory.find((c) => c.good_id.equals(goodId));
4702
+ return UInt64.from(this.cargomass).gte(this.maxCapacity);
3903
4703
  }
3904
4704
  get orbitalAltitude() {
3905
- return this.location.z?.toNumber() || 0;
4705
+ return this.coordinates.z?.toNumber() || 0;
3906
4706
  }
3907
4707
  }
3908
4708
 
@@ -3938,25 +4738,37 @@ class EntitiesManager extends BaseManager {
3938
4738
  async getWarehouse(id) {
3939
4739
  return (await this.getEntity('warehouse', id));
3940
4740
  }
4741
+ async getContainer(id) {
4742
+ return (await this.getEntity('container', id));
4743
+ }
3941
4744
  async getShips(owner) {
3942
4745
  return (await this.getEntities(owner, 'ship'));
3943
4746
  }
3944
4747
  async getWarehouses(owner) {
3945
4748
  return (await this.getEntities(owner, 'warehouse'));
3946
4749
  }
4750
+ async getContainers(owner) {
4751
+ return (await this.getEntities(owner, 'container'));
4752
+ }
3947
4753
  async getShipSummaries(owner) {
3948
4754
  return this.getSummaries(owner, 'ship');
3949
4755
  }
3950
4756
  async getWarehouseSummaries(owner) {
3951
4757
  return this.getSummaries(owner, 'warehouse');
3952
4758
  }
4759
+ async getContainerSummaries(owner) {
4760
+ return this.getSummaries(owner, 'container');
4761
+ }
3953
4762
  wrapEntity(entity) {
3954
4763
  if (entity.type.equals('ship')) {
3955
4764
  return new Ship(entity);
3956
4765
  }
3957
- else {
4766
+ else if (entity.type.equals('warehouse')) {
3958
4767
  return new Warehouse(entity);
3959
4768
  }
4769
+ else {
4770
+ return new Container(entity);
4771
+ }
3960
4772
  }
3961
4773
  resolveOwner(owner) {
3962
4774
  if (typeof owner === 'object' && owner !== null && 'owner' in owner) {
@@ -4096,7 +4908,7 @@ class Player extends Types.player_row {
4096
4908
  }
4097
4909
  }
4098
4910
  Player.MAX_LOAN = 1000000;
4099
- Player.BASE_SHIP_COST = 100;
4911
+ Player.BASE_SHIP_COST = 500;
4100
4912
  Player.SHIP_COST_MULTIPLIER = 5;
4101
4913
 
4102
4914
  class PlayersManager extends BaseManager {
@@ -4253,27 +5065,28 @@ function getSupply(gameSeed, state, location, goodId) {
4253
5065
  const r = roll(gameSeed, seed);
4254
5066
  const percent = r / 65535;
4255
5067
  const epoch = 1 + Number(state.epoch) / 90;
4256
- const ship = Math.pow(Number(state.ships), 0);
5068
+ const ship = 1;
4257
5069
  const goodIdNum = Number(goodId);
4258
- return Math.floor((128 / goodIdNum) * percent * ship * epoch);
5070
+ const base = Math.floor(128 / goodIdNum);
5071
+ return Math.floor(base * percent * ship * epoch);
4259
5072
  }
4260
5073
  function marketPrice(location, goodId, gameSeed, state) {
4261
- const good = getGood(goodId);
4262
- let price = Number(good.base_price);
5074
+ const item = getItem(goodId);
5075
+ let price = Number(item.base_price);
4263
5076
  const rarityMultiplier = getRarityMultiplier(gameSeed, state.seed, location, goodId);
4264
5077
  price *= rarityMultiplier;
4265
5078
  const locationMultiplier = getLocationMultiplier(gameSeed, location, goodId);
4266
5079
  price *= locationMultiplier;
4267
5080
  const supply = getSupply(gameSeed, state, location, goodId);
4268
- return GoodPrice.from({
5081
+ return ItemPrice.from({
4269
5082
  id: goodId,
4270
- good,
5083
+ item,
4271
5084
  price: UInt32.from(price),
4272
5085
  supply: UInt16.from(supply),
4273
5086
  });
4274
5087
  }
4275
5088
  function marketPrices(location, gameSeed, state) {
4276
- return getGoods().map((good) => marketPrice(location, good.id, gameSeed, state));
5089
+ return getItems().map((item) => marketPrice(location, item.id, gameSeed, state));
4277
5090
  }
4278
5091
 
4279
5092
  class LocationsManager extends BaseManager {
@@ -4288,24 +5101,24 @@ class LocationsManager extends BaseManager {
4288
5101
  return marketPrices(location, game.config.seed, state);
4289
5102
  }
4290
5103
  async getMarketPricesWithSupply(location) {
4291
- const [game, state, locationRows] = await Promise.all([
5104
+ const [game, state, supplyRows] = await Promise.all([
4292
5105
  this.getGame(),
4293
5106
  this.getState(),
4294
- this.getLocation(location),
5107
+ this.getSupplyRows(location),
4295
5108
  ]);
4296
5109
  const prices = marketPrices(location, game.config.seed, state);
4297
5110
  const supplyMap = new Map();
4298
- for (const row of locationRows) {
5111
+ for (const row of supplyRows) {
4299
5112
  if (UInt64.from(row.epoch).equals(state.epoch)) {
4300
- supplyMap.set(Number(row.good_id), Number(row.supply));
5113
+ supplyMap.set(Number(row.item_id), Number(row.supply));
4301
5114
  }
4302
5115
  }
4303
5116
  return prices.map((price) => {
4304
5117
  const actualSupply = supplyMap.get(Number(price.id));
4305
5118
  if (actualSupply !== undefined) {
4306
- return GoodPrice.from({
5119
+ return ItemPrice.from({
4307
5120
  id: price.id,
4308
- good: price.good,
5121
+ item: price.item,
4309
5122
  price: price.price,
4310
5123
  supply: UInt64.from(actualSupply),
4311
5124
  });
@@ -4321,9 +5134,9 @@ class LocationsManager extends BaseManager {
4321
5134
  const game = await this.getGame();
4322
5135
  return findNearbyPlanets(game.config.seed, origin, maxDistance);
4323
5136
  }
4324
- async getLocation(location) {
5137
+ async getSupplyRows(location) {
4325
5138
  const hash = Checksum256.hash(Bytes.from(`${location.x}-${location.y}`, 'utf8'));
4326
- return this.server.table('location').all({
5139
+ return this.server.table('supply').all({
4327
5140
  index_position: 'secondary',
4328
5141
  from: hash,
4329
5142
  to: hash,
@@ -4338,7 +5151,7 @@ class LocationsManager extends BaseManager {
4338
5151
  async getLocationWithSupply(coords) {
4339
5152
  const location = toLocation(coords);
4340
5153
  const [rows, state] = await Promise.all([
4341
- this.getLocation(location.coordinates),
5154
+ this.getSupplyRows(location.coordinates),
4342
5155
  this.getState(),
4343
5156
  ]);
4344
5157
  location.setLocationRows(rows, state.epoch);
@@ -4348,13 +5161,24 @@ class LocationsManager extends BaseManager {
4348
5161
  const location = toLocation(coords);
4349
5162
  const [prices, rows, state] = await Promise.all([
4350
5163
  this.getMarketPrices(location.coordinates),
4351
- this.getLocation(location.coordinates),
5164
+ this.getSupplyRows(location.coordinates),
4352
5165
  this.getState(),
4353
5166
  ]);
4354
5167
  location.setMarketPrices(prices);
4355
5168
  location.setLocationRows(rows, state.epoch);
4356
5169
  return location;
4357
5170
  }
5171
+ async getLocationEntity(id) {
5172
+ const row = await this.server.table('location').get(UInt64.from(id));
5173
+ return row ?? undefined;
5174
+ }
5175
+ async getLocationEntityAt(coords) {
5176
+ const id = coordsToLocationId(coords);
5177
+ return this.getLocationEntity(id);
5178
+ }
5179
+ async getAllLocationEntities() {
5180
+ return this.server.table('location').all();
5181
+ }
4358
5182
  }
4359
5183
 
4360
5184
  function calculateUpdatedCargoCost(currentPaid, currentOwned, purchaseCost, purchaseQuantity) {
@@ -4364,7 +5188,7 @@ function calculateUpdatedCargoCost(currentPaid, currentOwned, purchaseCost, purc
4364
5188
  }
4365
5189
  function calculateMaxTradeQuantity(ship, player, goodPrice) {
4366
5190
  const pricePerUnit = UInt32.from(goodPrice.price);
4367
- const massPerUnit = UInt32.from(goodPrice.good.mass);
5191
+ const massPerUnit = UInt32.from(goodPrice.item.mass);
4368
5192
  const spaceForQuantity = ship.availableCapacity.dividing(massPerUnit);
4369
5193
  const affordableQuantity = player.balance.dividing(pricePerUnit);
4370
5194
  const maxQuantity = spaceForQuantity.lt(affordableQuantity)
@@ -4397,7 +5221,7 @@ function calculateProfitPerSecond(profit, travelTimeSeconds) {
4397
5221
  const t = UInt32.from(travelTimeSeconds);
4398
5222
  return t.gt(UInt32.zero) ? Number(profit) / Number(t) : 0;
4399
5223
  }
4400
- function findBestGoodToTrade(ship, player, originPrices, destPrices, travelTimeSeconds) {
5224
+ function findBestItemToTrade(ship, player, originPrices, destPrices, travelTimeSeconds) {
4401
5225
  let bestTrade = null;
4402
5226
  let bestProfitPerSecond = 0;
4403
5227
  for (const originPrice of originPrices) {
@@ -4414,7 +5238,7 @@ function findBestGoodToTrade(ship, player, originPrices, destPrices, travelTimeS
4414
5238
  if (profitPerSecond > bestProfitPerSecond) {
4415
5239
  bestProfitPerSecond = profitPerSecond;
4416
5240
  bestTrade = {
4417
- good: originPrice,
5241
+ item: originPrice,
4418
5242
  quantity: calc.maxQuantity,
4419
5243
  profit: Number(tradeResult.profit),
4420
5244
  profitPerSecond,
@@ -4464,7 +5288,7 @@ async function findDealsForShip(ship, originLocation, getNearbyLocations, getMar
4464
5288
  const canAfford = balance !== undefined
4465
5289
  ? balance.dividing(originGood.price)
4466
5290
  : UInt64.from(Number.MAX_SAFE_INTEGER);
4467
- const canHaul = effectiveAvailableMass.dividing(originGood.good.mass);
5291
+ const canHaul = effectiveAvailableMass.dividing(originGood.item.mass);
4468
5292
  const supplyLimit = UInt64.from(originGood.supply);
4469
5293
  let maxQuantity = canAfford;
4470
5294
  if (canHaul.lt(maxQuantity))
@@ -4473,7 +5297,7 @@ async function findDealsForShip(ship, originLocation, getNearbyLocations, getMar
4473
5297
  maxQuantity = supplyLimit;
4474
5298
  if (maxQuantity.equals(UInt64.zero))
4475
5299
  continue;
4476
- const cargoMass = originGood.good.mass.multiplying(maxQuantity);
5300
+ const cargoMass = originGood.item.mass.multiplying(maxQuantity);
4477
5301
  const availableSpaceUInt = UInt64.from(availableSpace);
4478
5302
  const baseMass = availableSpace !== undefined
4479
5303
  ? shipCapacity.gte(availableSpaceUInt)
@@ -4496,7 +5320,7 @@ async function findDealsForShip(ship, originLocation, getNearbyLocations, getMar
4496
5320
  deals.push({
4497
5321
  origin,
4498
5322
  destination: destLocation,
4499
- good: originGood,
5323
+ item: originGood,
4500
5324
  distance,
4501
5325
  supply: originGood.supply,
4502
5326
  buyPrice: originGood.price,
@@ -4526,7 +5350,7 @@ function calculateCargoMass(cargo) {
4526
5350
  let mass = UInt32.from(0);
4527
5351
  for (const c of cargo) {
4528
5352
  if (UInt64.from(c.quantity).gt(UInt64.zero)) {
4529
- const goodMass = getGood(c.good_id).mass;
5353
+ const goodMass = getItem(c.item_id).mass;
4530
5354
  mass = mass.adding(goodMass.multiplying(c.quantity));
4531
5355
  }
4532
5356
  }
@@ -4548,7 +5372,7 @@ function analyzeCargoSale(cargo, prices) {
4548
5372
  for (const c of cargo) {
4549
5373
  if (UInt64.from(c.quantity).equals(UInt64.zero))
4550
5374
  continue;
4551
- const goodId = Number(c.good_id);
5375
+ const goodId = Number(c.item_id);
4552
5376
  const salePrice = prices.get(goodId);
4553
5377
  if (salePrice) {
4554
5378
  revenue = revenue.adding(UInt64.from(salePrice).multiplying(c.quantity));
@@ -4566,15 +5390,15 @@ function buildCargoSaleItems(cargo, prices) {
4566
5390
  for (const c of cargo) {
4567
5391
  if (UInt64.from(c.quantity).equals(UInt64.zero))
4568
5392
  continue;
4569
- const goodId = Number(c.good_id);
5393
+ const goodId = Number(c.item_id);
4570
5394
  const salePrice = prices.get(goodId);
4571
5395
  const pricePerUnit = salePrice ? UInt32.from(salePrice) : UInt32.zero;
4572
5396
  const revenue = UInt64.from(pricePerUnit).multiplying(c.quantity);
4573
5397
  const cost = c.unit_cost.multiplying(c.quantity);
4574
5398
  const profit = Int64.from(revenue).subtracting(cost);
4575
5399
  items.push({
4576
- goodId: c.good_id,
4577
- goodName: c.good?.name ?? `Good #${goodId}`,
5400
+ goodId: c.item_id,
5401
+ goodName: c.item?.name ?? `Item #${goodId}`,
4578
5402
  quantity: UInt32.from(c.quantity),
4579
5403
  pricePerUnit,
4580
5404
  revenue,
@@ -4604,10 +5428,10 @@ function createSellAndTradeOption(saleRevenue, saleCost, deal, cargoSale, unload
4604
5428
  }
4605
5429
  : undefined;
4606
5430
  return {
4607
- id: `sell-trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.good.id}`,
5431
+ id: `sell-trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.item.id}`,
4608
5432
  type: 'sell-and-trade',
4609
- title: `Trade ${deal.good.good.name}`,
4610
- description: `Sell cargo, buy ${deal.maxQuantity} ${deal.good.good.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
5433
+ title: `Trade ${deal.item.item.name}`,
5434
+ description: `Sell cargo, buy ${deal.maxQuantity} ${deal.item.item.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
4611
5435
  reason: `${deal.marginPercent.toFixed(0)}% margin, ${deal.profitPerSecond.toFixed(1)}/s profit rate`,
4612
5436
  recommended: false,
4613
5437
  highestProfit: false,
@@ -4669,7 +5493,7 @@ function createSellAndRepositionOption(saleRevenue, saleCost, reposition, cargoS
4669
5493
  id: `sell-reposition-${reposition.location.coordinates.x}-${reposition.location.coordinates.y}`,
4670
5494
  type: 'sell-and-reposition',
4671
5495
  title: 'Sell & Move',
4672
- description: `Sell cargo here, travel empty to buy ${deal.good.good.name}`,
5496
+ description: `Sell cargo here, travel empty to buy ${deal.item.item.name}`,
4673
5497
  reason: `No good trades here — ${deal.marginPercent.toFixed(0)}% margin trade available at destination`,
4674
5498
  recommended: false,
4675
5499
  highestProfit: false,
@@ -4788,9 +5612,9 @@ async function analyzeCollectOptions(ship, arrivedAt, callbacks, options = {}) {
4788
5612
  availableSpace: Number(ship.maxCapacity),
4789
5613
  });
4790
5614
  if (hasCargo && dealsAtOrigin.length > 0) {
4791
- const cargoGoodIds = new Set(cargo.map((c) => Number(c.good_id)));
5615
+ const cargoGoodIds = new Set(cargo.map((c) => Number(c.item_id)));
4792
5616
  for (const deal of dealsAtOrigin.slice(0, 3)) {
4793
- const dealGoodId = Number(deal.good.id);
5617
+ const dealGoodId = Number(deal.item.id);
4794
5618
  if (cargoGoodIds.has(dealGoodId)) {
4795
5619
  continue;
4796
5620
  }
@@ -4887,10 +5711,10 @@ async function analyzeCollectOptions(ship, arrivedAt, callbacks, options = {}) {
4887
5711
  if (!hasCargo && dealsAtOrigin.length > 0) {
4888
5712
  for (const deal of dealsAtOrigin.slice(0, 3)) {
4889
5713
  const option = {
4890
- id: `trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.good.id}`,
5714
+ id: `trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.item.id}`,
4891
5715
  type: 'sell-and-trade',
4892
- title: `Trade ${deal.good.good.name}`,
4893
- description: `Buy ${deal.maxQuantity} ${deal.good.good.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
5716
+ title: `Trade ${deal.item.item.name}`,
5717
+ description: `Buy ${deal.maxQuantity} ${deal.item.item.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
4894
5718
  reason: `${deal.marginPercent.toFixed(0)}% margin, ${deal.profitPerSecond.toFixed(1)}/s profit rate`,
4895
5719
  recommended: false,
4896
5720
  highestProfit: false,
@@ -4928,7 +5752,7 @@ async function analyzeCollectOptions(ship, arrivedAt, callbacks, options = {}) {
4928
5752
  let discountedGood;
4929
5753
  let bestDiscount = 0;
4930
5754
  if (gameSeed && state) {
4931
- const allGoods = getGoods();
5755
+ const allGoods = getItems();
4932
5756
  for (const good of allGoods) {
4933
5757
  const rarity = getRarity(gameSeed, state.seed, dest.coordinates, good.id);
4934
5758
  if (rarity.minMultiplier < 1.0) {
@@ -4956,8 +5780,8 @@ async function analyzeCollectOptions(ship, arrivedAt, callbacks, options = {}) {
4956
5780
  }
4957
5781
  const destDeals = await findDealsForShip(ship, dest.coordinates, callbacks.getNearbyLocations, callbacks.getMarketPrices, { maxDeals: 2 });
4958
5782
  const potentialDeals = destDeals.map((d) => ({
4959
- goodId: Number(d.good.id),
4960
- goodName: d.good.good.name,
5783
+ goodId: Number(d.item.id),
5784
+ goodName: d.item.item.name,
4961
5785
  destinationCoords: d.destination.coordinates,
4962
5786
  marginPercent: d.marginPercent,
4963
5787
  profitPerSecond: d.profitPerSecond,
@@ -5043,9 +5867,9 @@ class TradesManager extends BaseManager {
5043
5867
  const result = prices.map((price) => {
5044
5868
  const actualSupply = locationWithSupply.getSupply(price.id);
5045
5869
  if (actualSupply !== undefined) {
5046
- return GoodPrice.from({
5870
+ return ItemPrice.from({
5047
5871
  id: price.id,
5048
- good: price.good,
5872
+ item: price.item,
5049
5873
  price: price.price,
5050
5874
  supply: actualSupply,
5051
5875
  });
@@ -5064,7 +5888,7 @@ class TradesManager extends BaseManager {
5064
5888
  this.priceCacheEpoch = undefined;
5065
5889
  }
5066
5890
  async findDeals(ship, originLocation, options = {}) {
5067
- const origin = originLocation || ship.currentLocation;
5891
+ const origin = originLocation || Coordinates.from(ship.coordinates);
5068
5892
  const callbacks = await this.createCallbacks();
5069
5893
  const deals = await findDealsForShip(ship, origin, callbacks.getNearbyLocations, callbacks.getMarketPrices, options);
5070
5894
  return deals;
@@ -5074,7 +5898,7 @@ class TradesManager extends BaseManager {
5074
5898
  return deals[0];
5075
5899
  }
5076
5900
  async getCollectOptions(ship, arrivedAt, options = {}) {
5077
- const location = arrivedAt || ship.currentLocation;
5901
+ const location = arrivedAt || Coordinates.from(ship.coordinates);
5078
5902
  const callbacks = await this.createCallbacks();
5079
5903
  return analyzeCollectOptions(ship, location, callbacks, options);
5080
5904
  }
@@ -5131,6 +5955,20 @@ class ActionsManager extends BaseManager {
5131
5955
  recharge,
5132
5956
  });
5133
5957
  }
5958
+ grouptravel(entities, destination, recharge = true) {
5959
+ const entityRefs = entities.map((e) => Types.entity_ref.from({
5960
+ entity_type: e.entityType,
5961
+ entity_id: UInt64.from(e.entityId),
5962
+ }));
5963
+ const x = Int64.from(destination.x);
5964
+ const y = Int64.from(destination.y);
5965
+ return this.server.action('grouptravel', {
5966
+ entities: entityRefs,
5967
+ x,
5968
+ y,
5969
+ recharge,
5970
+ });
5971
+ }
5134
5972
  resolve(entityId, entityType = EntityType.SHIP) {
5135
5973
  return this.server.action('resolve', {
5136
5974
  entity_type: entityType,
@@ -5150,32 +5988,30 @@ class ActionsManager extends BaseManager {
5150
5988
  id: UInt64.from(shipId),
5151
5989
  });
5152
5990
  }
5153
- transfer(sourceType, sourceId, destType, destId, cargo) {
5154
- const cargoItems = cargo.map((c) => Types.cargo_item.from({
5155
- good_id: UInt16.from(c.goodId),
5156
- quantity: UInt32.from(c.quantity),
5157
- unit_cost: UInt64.from(c.unitCost || 0),
5158
- }));
5991
+ transfer(sourceType, sourceId, destType, destId, goodId, quantity) {
5159
5992
  return this.server.action('transfer', {
5160
5993
  source_type: sourceType,
5161
5994
  source_id: UInt64.from(sourceId),
5162
5995
  dest_type: destType,
5163
5996
  dest_id: UInt64.from(destId),
5164
- cargo: cargoItems,
5997
+ item_id: UInt16.from(goodId),
5998
+ quantity: UInt32.from(quantity),
5165
5999
  });
5166
6000
  }
5167
- buyGoods(shipId, goodId, quantity) {
5168
- return this.server.action('buygoods', {
5169
- ship_id: UInt64.from(shipId),
5170
- good_id: UInt64.from(goodId),
5171
- quantity: UInt64.from(quantity),
6001
+ buyItems(entityId, goodId, quantity, entityType = EntityType.SHIP) {
6002
+ return this.server.action('buyitems', {
6003
+ entity_type: entityType,
6004
+ id: UInt64.from(entityId),
6005
+ item_id: UInt16.from(goodId),
6006
+ quantity: UInt32.from(quantity),
5172
6007
  });
5173
6008
  }
5174
- sellGoods(shipId, goodId, quantity) {
5175
- return this.server.action('sellgoods', {
5176
- ship_id: UInt64.from(shipId),
5177
- good_id: UInt64.from(goodId),
5178
- quantity: UInt64.from(quantity),
6009
+ sellItems(entityId, goodId, quantity, entityType = EntityType.SHIP) {
6010
+ return this.server.action('sellitems', {
6011
+ entity_type: entityType,
6012
+ id: UInt64.from(entityId),
6013
+ item_id: UInt16.from(goodId),
6014
+ quantity: UInt32.from(quantity),
5179
6015
  });
5180
6016
  }
5181
6017
  buyShip(account, name) {
@@ -5191,6 +6027,13 @@ class ActionsManager extends BaseManager {
5191
6027
  name,
5192
6028
  });
5193
6029
  }
6030
+ buyContainer(account, shipId, name) {
6031
+ return this.server.action('buycontainer', {
6032
+ account: Name.from(account),
6033
+ ship_id: UInt64.from(shipId),
6034
+ name,
6035
+ });
6036
+ }
5194
6037
  takeLoan(account, amount) {
5195
6038
  return this.server.action('takeloan', {
5196
6039
  account: Name.from(account),
@@ -5214,6 +6057,21 @@ class ActionsManager extends BaseManager {
5214
6057
  account: Name.from(account),
5215
6058
  });
5216
6059
  }
6060
+ extract(shipId) {
6061
+ return this.server.action('extract', {
6062
+ ship_id: UInt64.from(shipId),
6063
+ });
6064
+ }
6065
+ warp(shipId, destination) {
6066
+ const x = Int64.from(destination.x);
6067
+ const y = Int64.from(destination.y);
6068
+ return this.server.action('warp', {
6069
+ entity_type: EntityType.SHIP,
6070
+ id: UInt64.from(shipId),
6071
+ x,
6072
+ y,
6073
+ });
6074
+ }
5217
6075
  joinGame(account, companyName) {
5218
6076
  return [this.foundCompany(account, companyName), this.join(account)];
5219
6077
  }
@@ -5231,11 +6089,7 @@ class ActionsManager extends BaseManager {
5231
6089
  const shipId = ship instanceof Ship ? ship.id : UInt64.from(ship);
5232
6090
  return shipCargo
5233
6091
  .filter((c) => c.hasCargo)
5234
- .map((c) => this.server.action('sellgoods', {
5235
- ship_id: shipId,
5236
- good_id: c.good_id,
5237
- quantity: c.quantity,
5238
- }));
6092
+ .map((c) => this.sellItems(shipId, c.item_id, c.quantity, EntityType.SHIP));
5239
6093
  }
5240
6094
  }
5241
6095
 
@@ -5382,178 +6236,328 @@ class Shipload {
5382
6236
  }
5383
6237
  }
5384
6238
 
5385
- function totalCargoMass(cargo) {
5386
- return cargo.reduce((sum, c) => {
5387
- return sum.adding(c.totalMass);
5388
- }, UInt64.from(0));
5389
- }
5390
- function cargoValue(cargo) {
5391
- return cargo.reduce((sum, c) => {
5392
- return sum.adding(c.totalCost);
5393
- }, UInt64.from(0));
6239
+ function makeShip(state) {
6240
+ const entityInfo = Types.entity_info.from({
6241
+ type: Name.from('ship'),
6242
+ id: UInt64.from(state.id),
6243
+ owner: Name.from(state.owner),
6244
+ entity_name: state.name,
6245
+ coordinates: Types.coordinates.from(state.coordinates),
6246
+ hullmass: UInt32.from(state.hullmass),
6247
+ capacity: UInt32.from(state.capacity),
6248
+ energy: UInt16.from(state.energy),
6249
+ cargomass: UInt32.from(0),
6250
+ cargo: state.cargo || [],
6251
+ is_idle: !state.schedule,
6252
+ current_task_elapsed: UInt32.from(0),
6253
+ current_task_remaining: UInt32.from(0),
6254
+ pending_tasks: [],
6255
+ engines: state.engines,
6256
+ generator: state.generator,
6257
+ loaders: state.loaders,
6258
+ schedule: state.schedule,
6259
+ });
6260
+ return new Ship(entityInfo);
5394
6261
  }
5395
- function getCargoForGood(cargo, goodId) {
5396
- return cargo.find((c) => c.good_id.equals(goodId));
6262
+ function makeWarehouse(state) {
6263
+ const entityInfo = Types.entity_info.from({
6264
+ type: Name.from('warehouse'),
6265
+ id: UInt64.from(state.id),
6266
+ owner: Name.from(state.owner),
6267
+ entity_name: state.name,
6268
+ coordinates: Types.coordinates.from(state.coordinates),
6269
+ capacity: UInt32.from(state.capacity),
6270
+ cargomass: UInt32.from(0),
6271
+ cargo: state.cargo || [],
6272
+ loaders: state.loaders,
6273
+ is_idle: !state.schedule,
6274
+ current_task_elapsed: UInt32.from(0),
6275
+ current_task_remaining: UInt32.from(0),
6276
+ pending_tasks: [],
6277
+ schedule: state.schedule,
6278
+ });
6279
+ return new Warehouse(entityInfo);
5397
6280
  }
5398
- function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
5399
- const additionalMass = goodMass.multiplying(quantity);
5400
- const totalMass = currentMass.adding(additionalMass);
5401
- return totalMass.lte(maxCapacity);
6281
+ function makeContainer(state) {
6282
+ const entityInfo = Types.entity_info.from({
6283
+ type: Name.from('container'),
6284
+ id: UInt64.from(state.id),
6285
+ owner: Name.from(state.owner),
6286
+ entity_name: state.name,
6287
+ coordinates: Types.coordinates.from(state.coordinates),
6288
+ hullmass: UInt32.from(state.hullmass),
6289
+ capacity: UInt32.from(state.capacity),
6290
+ cargomass: UInt32.from(state.cargomass || 0),
6291
+ cargo: [],
6292
+ is_idle: !state.schedule,
6293
+ current_task_elapsed: UInt32.from(0),
6294
+ current_task_remaining: UInt32.from(0),
6295
+ pending_tasks: [],
6296
+ schedule: state.schedule,
6297
+ });
6298
+ return new Container(entityInfo);
5402
6299
  }
5403
- function availableCapacity(currentMass, maxCapacity) {
5404
- if (currentMass.gte(maxCapacity)) {
5405
- return UInt64.from(0);
6300
+
6301
+ const DEPTH_THRESHOLD_COMMON = 0;
6302
+ const DEPTH_THRESHOLD_UNCOMMON = 2000;
6303
+ const DEPTH_THRESHOLD_RARE = 10000;
6304
+ const DEPTH_THRESHOLD_EPIC = 30000;
6305
+ const DEPTH_THRESHOLD_LEGENDARY = 55000;
6306
+ const LOCATION_MIN_DEPTH = 500;
6307
+ const LOCATION_MAX_DEPTH = 65535;
6308
+ const YIELD_THRESHOLD = Math.floor(0.003 * 0xffffffff);
6309
+ const PLANET_SUBTYPE_GAS_GIANT = 0;
6310
+ const PLANET_SUBTYPE_ROCKY = 1;
6311
+ const PLANET_SUBTYPE_TERRESTRIAL = 2;
6312
+ const PLANET_SUBTYPE_ICY = 3;
6313
+ const PLANET_SUBTYPE_OCEAN = 4;
6314
+ const PLANET_SUBTYPE_INDUSTRIAL = 5;
6315
+ const RESOURCE_CATALOG = [
6316
+ { id: 26, rarity: 'common' },
6317
+ { id: 1, rarity: 'common' },
6318
+ { id: 14, rarity: 'common' },
6319
+ { id: 6, rarity: 'common' },
6320
+ { id: 29, rarity: 'uncommon' },
6321
+ { id: 2, rarity: 'uncommon' },
6322
+ { id: 1000, rarity: 'uncommon' },
6323
+ { id: 1003, rarity: 'uncommon' },
6324
+ { id: 22, rarity: 'rare' },
6325
+ { id: 18, rarity: 'rare' },
6326
+ { id: 1001, rarity: 'rare' },
6327
+ { id: 1002, rarity: 'rare' },
6328
+ { id: 74, rarity: 'epic' },
6329
+ { id: 54, rarity: 'epic' },
6330
+ ];
6331
+ function getDepthThreshold(rarity) {
6332
+ switch (rarity) {
6333
+ case 'common':
6334
+ return DEPTH_THRESHOLD_COMMON;
6335
+ case 'uncommon':
6336
+ return DEPTH_THRESHOLD_UNCOMMON;
6337
+ case 'rare':
6338
+ return DEPTH_THRESHOLD_RARE;
6339
+ case 'epic':
6340
+ return DEPTH_THRESHOLD_EPIC;
6341
+ case 'legendary':
6342
+ return DEPTH_THRESHOLD_LEGENDARY;
5406
6343
  }
5407
- return maxCapacity.subtracting(currentMass);
5408
6344
  }
5409
- function isFull(currentMass, maxCapacity) {
5410
- return currentMass.gte(maxCapacity);
5411
- }
5412
-
5413
- var cargoUtils = /*#__PURE__*/Object.freeze({
5414
- __proto__: null,
5415
- totalCargoMass: totalCargoMass,
5416
- cargoValue: cargoValue,
5417
- getCargoForGood: getCargoForGood,
5418
- hasSpace: hasSpace,
5419
- availableCapacity: availableCapacity,
5420
- isFull: isFull
5421
- });
5422
-
5423
- function createProjectedEntity(entity) {
5424
- const cargoMass = entity.calcCargoMass();
5425
- const shipMass = UInt32.from(entity.mass);
5426
- const loaders = entity.loaders;
5427
- return {
5428
- location: Coordinates.from(entity.location),
5429
- energy: UInt16.from(entity.energy),
5430
- cargoMass,
5431
- shipMass,
5432
- capacity: entity.capacity,
5433
- engines: entity.engines,
5434
- generator: entity.generator,
5435
- loaders,
5436
- get totalMass() {
5437
- let mass = UInt64.from(this.shipMass).adding(this.cargoMass);
5438
- if (this.loaders) {
5439
- mass = mass.adding(this.loaders.mass.multiplying(this.loaders.quantity));
5440
- }
5441
- return mass;
5442
- },
5443
- };
6345
+ function getResourceRarity(itemId) {
6346
+ const entry = RESOURCE_CATALOG.find((r) => r.id === itemId);
6347
+ return entry ? entry.rarity : 'legendary';
5444
6348
  }
5445
- function applyRechargeTask(projected, _task, options) {
5446
- if (!projected.generator)
5447
- return;
5448
- if (options.complete) {
5449
- projected.energy = UInt16.from(projected.generator.capacity);
5450
- }
5451
- else if (options.progress !== undefined) {
5452
- const capacity = Number(projected.generator.capacity);
5453
- const currentEnergy = Number(projected.energy);
5454
- const rechargeAmount = (capacity - currentEnergy) * options.progress;
5455
- projected.energy = UInt16.from(Math.min(capacity, currentEnergy + rechargeAmount));
6349
+ function getResourceWeight(itemId, stratum) {
6350
+ const rarity = getResourceRarity(itemId);
6351
+ const threshold = getDepthThreshold(rarity);
6352
+ if (stratum < threshold)
6353
+ return 0;
6354
+ const depthAbove = stratum - threshold;
6355
+ switch (rarity) {
6356
+ case 'common':
6357
+ if (stratum < 2000)
6358
+ return 100;
6359
+ if (stratum < 10000)
6360
+ return 80;
6361
+ if (stratum < 30000)
6362
+ return 50;
6363
+ return 30;
6364
+ case 'uncommon':
6365
+ if (depthAbove < 3000)
6366
+ return 40;
6367
+ if (depthAbove < 8000)
6368
+ return 60;
6369
+ return 50;
6370
+ case 'rare':
6371
+ if (depthAbove < 5000)
6372
+ return 20;
6373
+ if (depthAbove < 15000)
6374
+ return 35;
6375
+ return 40;
6376
+ case 'epic':
6377
+ if (depthAbove < 10000)
6378
+ return 10;
6379
+ if (depthAbove < 25000)
6380
+ return 20;
6381
+ return 30;
6382
+ case 'legendary':
6383
+ return 10;
5456
6384
  }
5457
6385
  }
5458
- function applyFlightTask(projected, task, options) {
5459
- if (!task.location || !projected.engines)
5460
- return;
5461
- const origin = projected.location;
5462
- const destination = Coordinates.from(task.location);
5463
- const distance = distanceBetweenCoordinates(origin, task.location);
5464
- const energyUsage = distance.dividing(PRECISION).multiplying(projected.engines.drain);
5465
- if (options.complete) {
5466
- projected.energy = projected.energy.gt(energyUsage)
5467
- ? UInt16.from(projected.energy.subtracting(energyUsage))
5468
- : UInt16.from(0);
5469
- projected.location = destination;
5470
- }
5471
- else if (options.progress !== undefined) {
5472
- const interpolated = lerp(origin, destination, options.progress);
5473
- projected.location = Coordinates.from({
5474
- x: Math.round(interpolated.x),
5475
- y: Math.round(interpolated.y),
5476
- });
5477
- const partialEnergy = UInt64.from(Math.floor(Number(energyUsage) * options.progress));
5478
- projected.energy = projected.energy.gt(partialEnergy)
5479
- ? UInt16.from(projected.energy.subtracting(partialEnergy))
5480
- : UInt16.from(0);
6386
+ const ASTEROID_RESOURCES = [26, 29, 22, 74, 14, 1000, 1001];
6387
+ const NEBULA_RESOURCES = [1, 2, 18, 54];
6388
+ const GAS_GIANT_RESOURCES = [1, 2, 18, 54];
6389
+ const ROCKY_RESOURCES = [26, 29, 22, 74, 6, 1003, 1002];
6390
+ const TERRESTRIAL_RESOURCES = [6, 1003, 1002, 1001];
6391
+ const ICY_RESOURCES = [6, 14, 1000, 1001, 18];
6392
+ const OCEAN_RESOURCES = [1, 2, 1003, 1002];
6393
+ const INDUSTRIAL_RESOURCES = [26, 29, 22, 74, 14, 1000, 54];
6394
+ function getLocationCandidates(locationType, subtype) {
6395
+ if (locationType === 2)
6396
+ return ASTEROID_RESOURCES;
6397
+ if (locationType === 3)
6398
+ return NEBULA_RESOURCES;
6399
+ if (locationType === 1) {
6400
+ switch (subtype) {
6401
+ case PLANET_SUBTYPE_GAS_GIANT:
6402
+ return GAS_GIANT_RESOURCES;
6403
+ case PLANET_SUBTYPE_ROCKY:
6404
+ return ROCKY_RESOURCES;
6405
+ case PLANET_SUBTYPE_TERRESTRIAL:
6406
+ return TERRESTRIAL_RESOURCES;
6407
+ case PLANET_SUBTYPE_ICY:
6408
+ return ICY_RESOURCES;
6409
+ case PLANET_SUBTYPE_OCEAN:
6410
+ return OCEAN_RESOURCES;
6411
+ case PLANET_SUBTYPE_INDUSTRIAL:
6412
+ return INDUSTRIAL_RESOURCES;
6413
+ }
5481
6414
  }
6415
+ return [];
5482
6416
  }
5483
- function applyLoadTask(projected, task) {
5484
- for (const item of task.cargo) {
5485
- const good = getGood(item.good_id);
5486
- projected.cargoMass = projected.cargoMass.adding(good.mass.multiplying(item.quantity));
5487
- }
6417
+ function getEligibleResources(locationType, subtype, stratum) {
6418
+ const candidates = getLocationCandidates(locationType, subtype);
6419
+ return candidates.filter((itemId) => {
6420
+ const rarity = getResourceRarity(itemId);
6421
+ const threshold = getDepthThreshold(rarity);
6422
+ return stratum >= threshold;
6423
+ });
5488
6424
  }
5489
- function applyUnloadTask(projected, task) {
5490
- for (const item of task.cargo) {
5491
- const good = getGood(item.good_id);
5492
- const cargoMass = good.mass.multiplying(item.quantity);
5493
- projected.cargoMass = projected.cargoMass.gt(cargoMass)
5494
- ? projected.cargoMass.subtracting(cargoMass)
5495
- : UInt64.from(0);
5496
- }
6425
+ function depthScaleFactor(stratum) {
6426
+ if (stratum <= 1)
6427
+ return 1.0;
6428
+ const logScale = Math.log(stratum) / Math.log(65535);
6429
+ return 1.0 + logScale * 2.0;
5497
6430
  }
5498
- function projectEntity(entity) {
5499
- const projected = createProjectedEntity(entity);
5500
- if (!entity.schedule) {
5501
- return projected;
5502
- }
5503
- for (const task of entity.schedule.tasks) {
5504
- switch (task.type.toNumber()) {
5505
- case TaskType.RECHARGE:
5506
- applyRechargeTask(projected, task, { complete: true });
5507
- break;
5508
- case TaskType.FLIGHT:
5509
- applyFlightTask(projected, task, { complete: true });
5510
- break;
5511
- case TaskType.LOAD:
5512
- applyLoadTask(projected, task);
5513
- break;
5514
- case TaskType.UNLOAD:
5515
- applyUnloadTask(projected, task);
6431
+
6432
+ function deriveStratum(epochSeed, coords, stratum, locationType, subtype, _maxDepth) {
6433
+ const seed = Checksum256.from(epochSeed);
6434
+ const c = Coordinates.from(coords);
6435
+ const input = `stratum-${c.x}-${c.y}-${stratum}`;
6436
+ const hashResult = hash512(seed, input);
6437
+ const bytes = hashResult.array;
6438
+ const rawReserve = ((bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]) >>> 0;
6439
+ let reserve = 0;
6440
+ if (rawReserve <= YIELD_THRESHOLD) {
6441
+ const baseReserve = (rawReserve % 333) + 1;
6442
+ const scale = depthScaleFactor(stratum);
6443
+ reserve = Math.floor(baseReserve * scale);
6444
+ }
6445
+ if (reserve === 0)
6446
+ return { itemId: 0, seed: 0n, richness: 0, reserve: 0 };
6447
+ const eligible = getEligibleResources(locationType, subtype, stratum);
6448
+ if (eligible.length === 0)
6449
+ return { itemId: 0, seed: 0n, richness: 0, reserve: 0 };
6450
+ const resourceRoll = ((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7]) >>> 0;
6451
+ let totalWeight = 0;
6452
+ for (const id of eligible) {
6453
+ totalWeight += getResourceWeight(id, stratum);
6454
+ }
6455
+ let selectedItemId = eligible[0];
6456
+ if (totalWeight > 0) {
6457
+ const roll = resourceRoll % totalWeight;
6458
+ let cumulative = 0;
6459
+ for (const id of eligible) {
6460
+ cumulative += getResourceWeight(id, stratum);
6461
+ if (roll < cumulative) {
6462
+ selectedItemId = id;
5516
6463
  break;
6464
+ }
5517
6465
  }
5518
6466
  }
5519
- return projected;
6467
+ const seedBigInt = (BigInt(bytes[8]) << 56n) |
6468
+ (BigInt(bytes[9]) << 48n) |
6469
+ (BigInt(bytes[10]) << 40n) |
6470
+ (BigInt(bytes[11]) << 32n) |
6471
+ (BigInt(bytes[12]) << 24n) |
6472
+ (BigInt(bytes[13]) << 16n) |
6473
+ (BigInt(bytes[14]) << 8n) |
6474
+ BigInt(bytes[15]);
6475
+ const rawRichness = (bytes[16] << 8) | bytes[17];
6476
+ const normalized = rawRichness / 65535;
6477
+ const baseRichness = Math.floor(normalized * normalized * 999) + 1;
6478
+ let depthBonus = 0;
6479
+ if (stratum > 1) {
6480
+ depthBonus = 50 * Math.log(stratum) / Math.log(65535);
6481
+ }
6482
+ const richness = Math.min(Math.floor(baseRichness + depthBonus), 1000);
6483
+ return { itemId: selectedItemId, seed: seedBigInt, richness, reserve };
5520
6484
  }
5521
- function projectEntityAt(entity, now) {
5522
- const projected = createProjectedEntity(entity);
5523
- if (!entity.schedule || entity.schedule.tasks.length === 0) {
5524
- return projected;
5525
- }
5526
- for (let i = 0; i < entity.schedule.tasks.length; i++) {
5527
- const task = entity.schedule.tasks[i];
5528
- const taskComplete = isTaskComplete(entity, i, now);
5529
- const taskInProgress = isTaskInProgress(entity, i, now);
5530
- if (!taskComplete && !taskInProgress) {
5531
- break;
5532
- }
5533
- const progress = taskInProgress
5534
- ? getTaskElapsed(entity, i, now) / task.duration.toNumber()
5535
- : undefined;
5536
- switch (task.type.toNumber()) {
5537
- case TaskType.RECHARGE:
5538
- applyRechargeTask(projected, task, { complete: taskComplete, progress });
5539
- break;
5540
- case TaskType.FLIGHT:
5541
- applyFlightTask(projected, task, { complete: taskComplete, progress });
5542
- break;
5543
- case TaskType.LOAD:
5544
- if (taskComplete) {
5545
- applyLoadTask(projected, task);
5546
- }
5547
- break;
5548
- case TaskType.UNLOAD:
5549
- if (taskComplete) {
5550
- applyUnloadTask(projected, task);
5551
- }
5552
- break;
5553
- }
5554
- }
5555
- return projected;
6485
+ function deriveResourceStats(seed) {
6486
+ const seedStr = seed.toString();
6487
+ const encoder = new TextEncoder();
6488
+ const data = encoder.encode(seedStr);
6489
+ const hashResult = Checksum256.hash(Bytes.from(data));
6490
+ const hashBytes = hashResult.array;
6491
+ const extractU32 = (offset) => ((hashBytes[offset] << 24) |
6492
+ (hashBytes[offset + 1] << 16) |
6493
+ (hashBytes[offset + 2] << 8) |
6494
+ hashBytes[offset + 3]) >>>
6495
+ 0;
6496
+ return {
6497
+ purity: (extractU32(0) % 1000) + 1,
6498
+ density: (extractU32(4) % 1000) + 1,
6499
+ reactivity: (extractU32(8) % 1000) + 1,
6500
+ resonance: (extractU32(12) % 1000) + 1,
6501
+ };
6502
+ }
6503
+
6504
+ function deriveLocationSize(loc) {
6505
+ if (loc.type.toNumber() === LocationType.EMPTY)
6506
+ return 0;
6507
+ const raw = (loc.seed0.toNumber() << 8) | loc.seed1.toNumber();
6508
+ const normalized = raw / 65535;
6509
+ const curved = Math.pow(normalized, 3.0);
6510
+ const range = LOCATION_MAX_DEPTH - LOCATION_MIN_DEPTH;
6511
+ return Math.floor(LOCATION_MIN_DEPTH + curved * range);
6512
+ }
6513
+
6514
+ function canMove(e) {
6515
+ return 'engines' in e && 'generator' in e && 'energy' in e;
6516
+ }
6517
+ function hasEnergy(e) {
6518
+ return 'energy' in e;
6519
+ }
6520
+ function hasStorage(e) {
6521
+ return 'capacity' in e && 'cargo' in e;
6522
+ }
6523
+ function hasLoaders(e) {
6524
+ return 'loaders' in e && e.loaders !== undefined;
6525
+ }
6526
+ function hasTrade(e) {
6527
+ return 'trade' in e && e.trade !== undefined;
6528
+ }
6529
+ function hasMass(e) {
6530
+ return 'hullmass' in e;
6531
+ }
6532
+ function hasSchedule(e) {
6533
+ return 'schedule' in e;
6534
+ }
6535
+ function hasExtractor(e) {
6536
+ return 'extractor' in e && e.extractor !== undefined;
6537
+ }
6538
+
6539
+ function calcLoadDuration(entity, cargoMass) {
6540
+ const totalThrust = entity.loaders.thrust.toNumber() * entity.loaders.quantity.toNumber();
6541
+ if (totalThrust === 0)
6542
+ return UInt32.from(0);
6543
+ return UInt32.from(Math.ceil(Number(cargoMass) / totalThrust));
6544
+ }
6545
+
6546
+ function calc_extraction_duration(extractor, cargoMass, stratum, richness) {
6547
+ const rate = extractor.rate.toNumber();
6548
+ const efficiency = extractor.efficiency.toNumber();
6549
+ const drill = extractor.drill.toNumber();
6550
+ const rateProduct = Math.floor((rate * richness * efficiency) / PRECISION);
6551
+ if (rateProduct === 0)
6552
+ return UInt32.from(0);
6553
+ const extractionTime = Math.floor((cargoMass * PRECISION) / rateProduct);
6554
+ const drillTime = Math.floor(stratum / drill);
6555
+ return UInt32.from(extractionTime + drillTime);
6556
+ }
6557
+ function calc_extraction_energy(extractor, duration) {
6558
+ const energy = Math.floor((duration * extractor.drain.toNumber()) / PRECISION);
6559
+ return UInt16.from(energy);
5556
6560
  }
5557
6561
 
5558
- export { ActionsManager, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, Coordinates, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EntitiesManager, EntityInventory, EntityType, EpochsManager, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GOOD_DOES_NOT_EXIST, GOOD_NOT_AVAILABLE_AT_LOCATION, GameState, Good, GoodPrice, INITIAL_SHIP_MASS, INSUFFICIENT_BALANCE, INSUFFICIENT_GOOD_QUANTITY, INSUFFICIENT_GOOD_SUPPLY, INVALID_AMOUNT, Location, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, NO_SCHEDULE, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayersManager, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, server as ServerContract, Ship, Shipload, TaskCancelable, TaskType, TradesManager, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, Warehouse, analyzeCargoSale, analyzeCollectOptions, calc_acceleration, calc_energyusage, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, cargoUtils, createExploreOption, createProjectedEntity, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, distanceBetweenCoordinates, distanceBetweenPoints, estimateDealTravelTime, estimateTravelTime, findBestDeal, findBestGoodToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getEpochInfo, getGood, getGoods, getRarity, getSystemName, goodIds, hasEnergyForDistance, hasSystem, hash, hash512, isProfitable, lerp, marketPrice, marketPrices, projectEntity, projectEntityAt, rotation, schedule, toLocation };
6562
+ export { ActionsManager, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, Container, Coordinates, DEPTH_THRESHOLD_COMMON, DEPTH_THRESHOLD_EPIC, DEPTH_THRESHOLD_LEGENDARY, DEPTH_THRESHOLD_RARE, DEPTH_THRESHOLD_UNCOMMON, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EntitiesManager, EntityInventory, EntityType, EpochsManager, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_EXTRACTOR_DRAIN, INITIAL_EXTRACTOR_EFFICIENCY, INITIAL_EXTRACTOR_RATE, INITIAL_LOADER_MASS, INITIAL_LOADER_QUANTITY, INITIAL_LOADER_THRUST, INITIAL_SHIP_CAPACITY, INITIAL_SHIP_DRAIN, INITIAL_SHIP_ENERGY, INITIAL_SHIP_GENERATOR_CAPACITY, INITIAL_SHIP_HULLMASS, INITIAL_SHIP_MASS, INITIAL_SHIP_RECHARGE, INITIAL_SHIP_THRUST, INITIAL_SHIP_Z, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_DOES_NOT_EXIST, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, ItemPrice, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, NO_SCHEDULE, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayersManager, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, server as ServerContract, Ship, Shipload, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TradesManager, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, analyzeCargoSale, analyzeCollectOptions, availableCapacity$1 as availableCapacity, availableCapacityFromMass, calcCargoMass, calcCargoValue, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, canMove, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, capsHasTrade, cargoUtils, coordsToLocationId, createExploreOption, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, estimateDealTravelTime, estimateTravelTime, findBestDeal, findBestItemToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getRarity, getResourceRarity, getResourceWeight, getSystemName, hasEnergy, hasEnergyForDistance$1 as hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hasTrade, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isProfitable, itemIds, lerp, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, toLocation };
5559
6563
  //# sourceMappingURL=shipload.m.js.map