@shipload/sdk 2.0.0-rc1 → 2.0.0-rc2

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 (42) hide show
  1. package/README.md +349 -1
  2. package/lib/shipload.d.ts +609 -248
  3. package/lib/shipload.js +1683 -1031
  4. package/lib/shipload.js.map +1 -1
  5. package/lib/shipload.m.js +1613 -1047
  6. package/lib/shipload.m.js.map +1 -1
  7. package/package.json +1 -2
  8. package/src/capabilities/extraction.ts +37 -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 +340 -136
  15. package/src/data/goods.json +2 -2
  16. package/src/entities/cargo-utils.ts +96 -1
  17. package/src/entities/container.ts +70 -0
  18. package/src/entities/inventory-accessor.ts +46 -0
  19. package/src/entities/location.ts +22 -8
  20. package/src/entities/makers.ts +69 -0
  21. package/src/entities/player.ts +2 -1
  22. package/src/entities/ship.ts +86 -437
  23. package/src/entities/warehouse.ts +28 -144
  24. package/src/index-module.ts +34 -1
  25. package/src/managers/actions.ts +60 -28
  26. package/src/managers/entities.ts +22 -5
  27. package/src/managers/locations.ts +28 -9
  28. package/src/managers/trades.ts +2 -2
  29. package/src/market/market.ts +3 -4
  30. package/src/scheduling/accessor.ts +82 -0
  31. package/src/scheduling/projection.ts +125 -53
  32. package/src/scheduling/schedule.ts +24 -0
  33. package/src/trading/collect.ts +0 -1
  34. package/src/trading/deal.ts +0 -1
  35. package/src/travel/travel.ts +63 -2
  36. package/src/types/capabilities.ts +79 -0
  37. package/src/types/entity-traits.ts +70 -0
  38. package/src/types/entity.ts +36 -0
  39. package/src/types/index.ts +3 -0
  40. package/src/types.ts +75 -8
  41. package/src/utils/hash.ts +1 -1
  42. package/src/utils/system.ts +132 -4
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/C2NvbXBhbnlfcm93AAIHYWNjb3VudARuYW1lBG5hbWUGc3RyaW5nBmVuYWJsZQABB2VuYWJsZWQEYm9vbAplbmFibGVnYW1lAAIIY29udHJhY3QEbmFtZQdlbmFibGVkBGJvb2wMZm91bmRjb21wYW55AAIHYWNjb3VudARuYW1lBG5hbWUGc3RyaW5nC2dhbWVfY29uZmlnAAQEc2VlZAtjaGVja3N1bTI1NgllcG9jaHRpbWUGdWludDMyBXN0YXJ0DnRpbWVfcG9pbnRfc2VjA2VuZA50aW1lX3BvaW50X3NlYwlnYW1lX21ldGEABARuYW1lBnN0cmluZwtkZXNjcmlwdGlvbgZzdHJpbmcDdXJsBnN0cmluZwd2ZXJzaW9uBnN0cmluZwhnYW1lX3JvdwAECGNvbnRyYWN0BG5hbWUGY29uZmlnC2dhbWVfY29uZmlnBG1ldGEJZ2FtZV9tZXRhBXN0YXRlCmdhbWVfc3RhdGUKZ2FtZV9zdGF0ZQABB2VuYWJsZWQEYm9vbAlzdGFydGdhbWUABAhjb250cmFjdARuYW1lBmNvbmZpZwtnYW1lX2NvbmZpZwRtZXRhCWdhbWVfbWV0YQVzdGF0ZQpnYW1lX3N0YXRlCXN0YXRlX3JvdwABB2VuYWJsZWQEYm9vbAp1cGRhd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Zm9ybWF0aW9uIGFib3V0IHRoZSBzcGVjaWZpZWQgZ2FtZSBjb250cmFjdC4KCi0tLQAAAAAAoKrjBHdpcGWyAS0tLQoKc3BlY192ZXJzaW9uOiAiMC4yLjAiCnRpdGxlOiB3aXBlCnN1bW1hcnk6ICdERUJVRzogd2lwZSBhY3Rpb24nCmljb246IGh0dHBzOi8vYXZhdGFycy5naXRodWJ1c2VyY29udGVudC5jb20vdS8xNDcyOTI4NjE/cz00MDAmdT0zYjFhZjY2ZTkwZGQ4NTFmNGQ3YzA5NmVkNmEyZmJiNGI5ZTE5MGRhCgotLS0DAAAAwE9TJUUDaTY0AAALY29tcGFueV9yb3cAAAAAAKykYQNpNjQAAAhnYW1lX3JvdwAAAAAAlU3GA2k2NAAACXN0YXRlX3JvdwETU2hpcGxvYWQgKFBsYXRmb3JtKRNTaGlwbG9hZCAoUGxhdGZvcm0pAAAAAA==');
@@ -205,7 +205,7 @@ var platform = /*#__PURE__*/Object.freeze({
205
205
  Contract: Contract$1
206
206
  });
207
207
 
208
- const abiBlob = Blob.from('DmVvc2lvOjphYmkvMS4yAEEHYWR2YW5jZQACBnJldmVhbAZzdHJpbmcGY29tbWl0C2NoZWNrc3VtMjU2CGJ1eWdvb2RzAAMHc2hpcF9pZAZ1aW50NjQHZ29vZF9pZAZ1aW50MTYIcXVhbnRpdHkGdWludDMyB2J1eXNoaXAAAgdhY2NvdW50BG5hbWUEbmFtZQZzdHJpbmcMYnV5d2FyZWhvdXNlAAMHYWNjb3VudARuYW1lB3NoaXBfaWQGdWludDY0BG5hbWUGc3RyaW5nBmNhbmNlbAADC2VudGl0eV90eXBlBG5hbWUCaWQGdWludDY0BWNvdW50BnVpbnQ2NApjYW5jZWxfbG9nAAYFb3duZXIEbmFtZQtlbnRpdHlfdHlwZQRuYW1lCWVudGl0eV9pZAZ1aW50NjQKdGFza19pbmRleAV1aW50OAR0YXNrBHRhc2sKc3RhcnRlZF9hdAp0aW1lX3BvaW50DmNhbmNlbF9yZX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NhcmdvX3JvdwAAuGo6kydFA2k2NAAADWNvbnRhaW5lcl9yb3cAqqaX+ezyVANpNjQAAA9lbnRpdHlncm91cF9yb3cAAACTumwQjQNpNjQAAAxsb2NhdGlvbl9yb3cAAAAAXOVNrANpNjQAAApwbGF5ZXJfcm93AAAACk2lrcIDaTY0AAAMc2VxdWVuY2Vfcm93AAAAAABQXcMDaTY0AAAIc2hpcF9yb3cAAAAAAJVNxgNpNjQAAAlzdGF0ZV9yb3cAAAAA+FirxgNpNjQAAApzdXBwbHlfcm93AAAAAACsqs8DaTY0AAAJdHlwZXNfcm93AABQWNOmruEDaTY0AAANd2FyZWhvdXNlX3JvdwERU2hpcGxvYWQgKFNlcnZlcikRU2hpcGxvYWQgKFNlcnZlcikAAAAUAAAAOFHKvD4MdGFza19yZXN1bHRzAAAAAESFpkEOY2FuY2VsX3Jlc3VsdHMAAAAgI3NzVwx0YXNrX3Jlc3VsdHMAsHLZ5amyYg1lbnRpdHlfaW5mb1tdAADw2eWpsmILZW50aXR5X2luZm8AAAA4UcqyYgpnb29kc19pbmZvACZ12SAas2INbG9jYXRpb25faW5mbwCAySYhGrNiEGxvY2F0aW9uX2Rlcml2ZWQAAPDnGjWzYgtuZWFyYnlfaW5mbwAAuMqbWLNiC3BsYXllcl9pbmZvAMBV+ZqMs2IMc3RhcnRlcl9pbmZvgJW7RkqNs2IQZW50aXR5X3N1bW1hcnlbXQCi2ubmqullDHRhc2tfcmVzdWx0cwAAAAAA0LBpC2NoZWNrc3VtMjU2AAAAQITSsGkLY2hlY2tzdW01MTIAAACKXdOQugx0YXNrX3Jlc3VsdHMAAABA7Uixug9yZXNvbHZlX3Jlc3VsdHMAAMCJUhajwgx0YXNrX3Jlc3VsdHMAAABXLTzNzQx0YXNrX3Jlc3VsdHMAAAAARLXNzQx0YXNrX3Jlc3VsdHM=');
209
209
  const abi = ABI.from(abiBlob);
210
210
  var Types;
211
211
  (function (Types) {
@@ -221,11 +221,29 @@ var Types;
221
221
  Struct.type('advance')
222
222
  ], advance);
223
223
  Types.advance = advance;
224
+ let buycontainer = class buycontainer extends Struct {
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;
224
239
  let buygoods = class buygoods extends Struct {
225
240
  };
241
+ __decorate([
242
+ Struct.field(Name)
243
+ ], buygoods.prototype, "entity_type", void 0);
226
244
  __decorate([
227
245
  Struct.field(UInt64)
228
- ], buygoods.prototype, "ship_id", void 0);
246
+ ], buygoods.prototype, "id", void 0);
229
247
  __decorate([
230
248
  Struct.field(UInt16)
231
249
  ], buygoods.prototype, "good_id", void 0);
@@ -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,55 @@ 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 mixture_component = class mixture_component extends Struct {
336
+ };
337
+ __decorate([
338
+ Struct.field(UInt16)
339
+ ], mixture_component.prototype, "good_id", void 0);
340
+ __decorate([
341
+ Struct.field(UInt16)
342
+ ], mixture_component.prototype, "purity", void 0);
343
+ mixture_component = __decorate([
344
+ Struct.type('mixture_component')
345
+ ], mixture_component);
346
+ Types.mixture_component = mixture_component;
347
+ let mixture_info = class mixture_info extends Struct {
348
+ };
349
+ __decorate([
350
+ Struct.field(mixture_component, { array: true })
351
+ ], mixture_info.prototype, "components", void 0);
352
+ mixture_info = __decorate([
353
+ Struct.type('mixture_info')
354
+ ], mixture_info);
355
+ Types.mixture_info = mixture_info;
356
+ let cargo_item = class cargo_item extends Struct {
357
+ };
358
+ __decorate([
359
+ Struct.field(UInt16)
360
+ ], cargo_item.prototype, "good_id", void 0);
361
+ __decorate([
362
+ Struct.field(UInt32)
363
+ ], cargo_item.prototype, "quantity", void 0);
364
+ __decorate([
365
+ Struct.field(UInt64)
366
+ ], cargo_item.prototype, "unit_cost", void 0);
367
+ __decorate([
368
+ Struct.field(mixture_info, { optional: true })
369
+ ], cargo_item.prototype, "mixture", void 0);
370
+ cargo_item = __decorate([
371
+ Struct.type('cargo_item')
372
+ ], cargo_item);
373
+ Types.cargo_item = cargo_item;
380
374
  let cargo_row = class cargo_row extends Struct {
381
375
  };
382
376
  __decorate([
@@ -422,6 +416,96 @@ var Types;
422
416
  Struct.type('commit')
423
417
  ], commit);
424
418
  Types.commit = commit;
419
+ let coordinates = class coordinates extends Struct {
420
+ };
421
+ __decorate([
422
+ Struct.field(Int64)
423
+ ], coordinates.prototype, "x", void 0);
424
+ __decorate([
425
+ Struct.field(Int64)
426
+ ], coordinates.prototype, "y", void 0);
427
+ __decorate([
428
+ Struct.field(UInt16, { optional: true })
429
+ ], coordinates.prototype, "z", void 0);
430
+ coordinates = __decorate([
431
+ Struct.type('coordinates')
432
+ ], coordinates);
433
+ Types.coordinates = coordinates;
434
+ let task = class task extends Struct {
435
+ };
436
+ __decorate([
437
+ Struct.field(UInt8)
438
+ ], task.prototype, "type", void 0);
439
+ __decorate([
440
+ Struct.field(UInt32)
441
+ ], task.prototype, "duration", void 0);
442
+ __decorate([
443
+ Struct.field(UInt8)
444
+ ], task.prototype, "cancelable", void 0);
445
+ __decorate([
446
+ Struct.field(coordinates, { optional: true })
447
+ ], task.prototype, "coordinates", void 0);
448
+ __decorate([
449
+ Struct.field(cargo_item, { array: true })
450
+ ], task.prototype, "cargo", void 0);
451
+ __decorate([
452
+ Struct.field(entity_ref, { optional: true })
453
+ ], task.prototype, "entitytarget", void 0);
454
+ __decorate([
455
+ Struct.field(UInt64, { optional: true })
456
+ ], task.prototype, "entitygroup", void 0);
457
+ __decorate([
458
+ Struct.field(Int64, { optional: true })
459
+ ], task.prototype, "credits", void 0);
460
+ __decorate([
461
+ Struct.field(UInt16, { optional: true })
462
+ ], task.prototype, "energy_cost", void 0);
463
+ task = __decorate([
464
+ Struct.type('task')
465
+ ], task);
466
+ Types.task = task;
467
+ let schedule = class schedule extends Struct {
468
+ };
469
+ __decorate([
470
+ Struct.field(TimePoint)
471
+ ], schedule.prototype, "started", void 0);
472
+ __decorate([
473
+ Struct.field(task, { array: true })
474
+ ], schedule.prototype, "tasks", void 0);
475
+ schedule = __decorate([
476
+ Struct.type('schedule')
477
+ ], schedule);
478
+ Types.schedule = schedule;
479
+ let container_row = class container_row extends Struct {
480
+ };
481
+ __decorate([
482
+ Struct.field(UInt64)
483
+ ], container_row.prototype, "id", void 0);
484
+ __decorate([
485
+ Struct.field(Name)
486
+ ], container_row.prototype, "owner", void 0);
487
+ __decorate([
488
+ Struct.field('string')
489
+ ], container_row.prototype, "name", void 0);
490
+ __decorate([
491
+ Struct.field(coordinates)
492
+ ], container_row.prototype, "coordinates", void 0);
493
+ __decorate([
494
+ Struct.field(UInt32)
495
+ ], container_row.prototype, "hullmass", void 0);
496
+ __decorate([
497
+ Struct.field(UInt32)
498
+ ], container_row.prototype, "capacity", void 0);
499
+ __decorate([
500
+ Struct.field(UInt32)
501
+ ], container_row.prototype, "cargomass", void 0);
502
+ __decorate([
503
+ Struct.field(schedule, { optional: true })
504
+ ], container_row.prototype, "schedule", void 0);
505
+ container_row = __decorate([
506
+ Struct.type('container_row')
507
+ ], container_row);
508
+ Types.container_row = container_row;
425
509
  let enable = class enable extends Struct {
426
510
  };
427
511
  __decorate([
@@ -443,6 +527,18 @@ var Types;
443
527
  Struct.type('energy_stats')
444
528
  ], energy_stats);
445
529
  Types.energy_stats = energy_stats;
530
+ let entity_current_state = class entity_current_state extends Struct {
531
+ };
532
+ __decorate([
533
+ Struct.field(coordinates)
534
+ ], entity_current_state.prototype, "coordinates", void 0);
535
+ __decorate([
536
+ Struct.field(UInt16)
537
+ ], entity_current_state.prototype, "energy", void 0);
538
+ entity_current_state = __decorate([
539
+ Struct.type('entity_current_state')
540
+ ], entity_current_state);
541
+ Types.entity_current_state = entity_current_state;
446
542
  let loader_stats = class loader_stats extends Struct {
447
543
  };
448
544
  __decorate([
@@ -470,18 +566,21 @@ var Types;
470
566
  Struct.type('movement_stats')
471
567
  ], movement_stats);
472
568
  Types.movement_stats = movement_stats;
473
- let schedule = class schedule extends Struct {
569
+ let extractor_stats = class extractor_stats extends Struct {
474
570
  };
475
571
  __decorate([
476
- Struct.field(TimePoint)
477
- ], schedule.prototype, "started", void 0);
572
+ Struct.field(UInt16)
573
+ ], extractor_stats.prototype, "rate", void 0);
478
574
  __decorate([
479
- Struct.field(task, { array: true })
480
- ], schedule.prototype, "tasks", void 0);
481
- schedule = __decorate([
482
- Struct.type('schedule')
483
- ], schedule);
484
- Types.schedule = schedule;
575
+ Struct.field(UInt16)
576
+ ], extractor_stats.prototype, "drain", void 0);
577
+ __decorate([
578
+ Struct.field(UInt16)
579
+ ], extractor_stats.prototype, "efficiency", void 0);
580
+ extractor_stats = __decorate([
581
+ Struct.type('extractor_stats')
582
+ ], extractor_stats);
583
+ Types.extractor_stats = extractor_stats;
485
584
  let entity_info = class entity_info extends Struct {
486
585
  };
487
586
  __decorate([
@@ -498,7 +597,7 @@ var Types;
498
597
  ], entity_info.prototype, "entity_name", void 0);
499
598
  __decorate([
500
599
  Struct.field(coordinates)
501
- ], entity_info.prototype, "location", void 0);
600
+ ], entity_info.prototype, "coordinates", void 0);
502
601
  __decorate([
503
602
  Struct.field(UInt32)
504
603
  ], entity_info.prototype, "cargomass", void 0);
@@ -513,7 +612,7 @@ var Types;
513
612
  ], entity_info.prototype, "energy", void 0);
514
613
  __decorate([
515
614
  Struct.field(UInt32, { optional: true })
516
- ], entity_info.prototype, "mass", void 0);
615
+ ], entity_info.prototype, "hullmass", void 0);
517
616
  __decorate([
518
617
  Struct.field(movement_stats, { optional: true })
519
618
  ], entity_info.prototype, "engines", void 0);
@@ -523,6 +622,9 @@ var Types;
523
622
  __decorate([
524
623
  Struct.field(UInt32, { optional: true })
525
624
  ], entity_info.prototype, "capacity", void 0);
625
+ __decorate([
626
+ Struct.field(extractor_stats, { optional: true })
627
+ ], entity_info.prototype, "extractor", void 0);
526
628
  __decorate([
527
629
  Struct.field('bool')
528
630
  ], entity_info.prototype, "is_idle", void 0);
@@ -548,18 +650,6 @@ var Types;
548
650
  Struct.type('entity_info')
549
651
  ], entity_info);
550
652
  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
653
  let entity_summary = class entity_summary extends Struct {
564
654
  };
565
655
  __decorate([
@@ -576,7 +666,7 @@ var Types;
576
666
  ], entity_summary.prototype, "entity_name", void 0);
577
667
  __decorate([
578
668
  Struct.field(coordinates)
579
- ], entity_summary.prototype, "location", void 0);
669
+ ], entity_summary.prototype, "coordinates", void 0);
580
670
  __decorate([
581
671
  Struct.field('bool')
582
672
  ], entity_summary.prototype, "is_idle", void 0);
@@ -608,6 +698,27 @@ var Types;
608
698
  Struct.type('entity_task_info')
609
699
  ], entity_task_info);
610
700
  Types.entity_task_info = entity_task_info;
701
+ let entitygroup_row = class entitygroup_row extends Struct {
702
+ };
703
+ __decorate([
704
+ Struct.field(UInt64)
705
+ ], entitygroup_row.prototype, "id", void 0);
706
+ __decorate([
707
+ Struct.field(entity_ref, { array: true })
708
+ ], entitygroup_row.prototype, "participants", void 0);
709
+ entitygroup_row = __decorate([
710
+ Struct.type('entitygroup_row')
711
+ ], entitygroup_row);
712
+ Types.entitygroup_row = entitygroup_row;
713
+ let extract = class extract extends Struct {
714
+ };
715
+ __decorate([
716
+ Struct.field(UInt64)
717
+ ], extract.prototype, "ship_id", void 0);
718
+ extract = __decorate([
719
+ Struct.type('extract')
720
+ ], extract);
721
+ Types.extract = extract;
611
722
  let getentities = class getentities extends Struct {
612
723
  };
613
724
  __decorate([
@@ -650,6 +761,18 @@ var Types;
650
761
  Struct.type('getlocation')
651
762
  ], getlocation);
652
763
  Types.getlocation = getlocation;
764
+ let getlocdata = class getlocdata extends Struct {
765
+ };
766
+ __decorate([
767
+ Struct.field(Int64)
768
+ ], getlocdata.prototype, "x", void 0);
769
+ __decorate([
770
+ Struct.field(Int64)
771
+ ], getlocdata.prototype, "y", void 0);
772
+ getlocdata = __decorate([
773
+ Struct.type('getlocdata')
774
+ ], getlocdata);
775
+ Types.getlocdata = getlocdata;
653
776
  let getnearby = class getnearby extends Struct {
654
777
  };
655
778
  __decorate([
@@ -674,6 +797,12 @@ var Types;
674
797
  Struct.type('getplayer')
675
798
  ], getplayer);
676
799
  Types.getplayer = getplayer;
800
+ let getstarter = class getstarter extends Struct {
801
+ };
802
+ getstarter = __decorate([
803
+ Struct.type('getstarter')
804
+ ], getstarter);
805
+ Types.getstarter = getstarter;
677
806
  let getsummaries = class getsummaries extends Struct {
678
807
  };
679
808
  __decorate([
@@ -710,6 +839,24 @@ var Types;
710
839
  Struct.type('goods_info')
711
840
  ], goods_info);
712
841
  Types.goods_info = goods_info;
842
+ let grouptravel = class grouptravel extends Struct {
843
+ };
844
+ __decorate([
845
+ Struct.field(entity_ref, { array: true })
846
+ ], grouptravel.prototype, "entities", void 0);
847
+ __decorate([
848
+ Struct.field(Int64)
849
+ ], grouptravel.prototype, "x", void 0);
850
+ __decorate([
851
+ Struct.field(Int64)
852
+ ], grouptravel.prototype, "y", void 0);
853
+ __decorate([
854
+ Struct.field('bool')
855
+ ], grouptravel.prototype, "recharge", void 0);
856
+ grouptravel = __decorate([
857
+ Struct.type('grouptravel')
858
+ ], grouptravel);
859
+ Types.grouptravel = grouptravel;
713
860
  let hash = class hash extends Struct {
714
861
  };
715
862
  __decorate([
@@ -746,6 +893,54 @@ var Types;
746
893
  Struct.type('join')
747
894
  ], join);
748
895
  Types.join = join;
896
+ let location_static = class location_static extends Struct {
897
+ };
898
+ __decorate([
899
+ Struct.field(coordinates)
900
+ ], location_static.prototype, "coords", void 0);
901
+ __decorate([
902
+ Struct.field(UInt8)
903
+ ], location_static.prototype, "type", void 0);
904
+ __decorate([
905
+ Struct.field(UInt8)
906
+ ], location_static.prototype, "subtype", void 0);
907
+ __decorate([
908
+ Struct.field(UInt8)
909
+ ], location_static.prototype, "seed0", void 0);
910
+ __decorate([
911
+ Struct.field(UInt8)
912
+ ], location_static.prototype, "seed1", void 0);
913
+ location_static = __decorate([
914
+ Struct.type('location_static')
915
+ ], location_static);
916
+ Types.location_static = location_static;
917
+ let location_epoch = class location_epoch extends Struct {
918
+ };
919
+ __decorate([
920
+ Struct.field('bool')
921
+ ], location_epoch.prototype, "active", void 0);
922
+ __decorate([
923
+ Struct.field(UInt8)
924
+ ], location_epoch.prototype, "seed0", void 0);
925
+ __decorate([
926
+ Struct.field(UInt8)
927
+ ], location_epoch.prototype, "seed1", void 0);
928
+ location_epoch = __decorate([
929
+ Struct.type('location_epoch')
930
+ ], location_epoch);
931
+ Types.location_epoch = location_epoch;
932
+ let location_derived = class location_derived extends Struct {
933
+ };
934
+ __decorate([
935
+ Struct.field(location_static)
936
+ ], location_derived.prototype, "static_props", void 0);
937
+ __decorate([
938
+ Struct.field(location_epoch)
939
+ ], location_derived.prototype, "epoch_props", void 0);
940
+ location_derived = __decorate([
941
+ Struct.type('location_derived')
942
+ ], location_derived);
943
+ Types.location_derived = location_derived;
749
944
  let location_good = class location_good extends Struct {
750
945
  };
751
946
  __decorate([
@@ -787,96 +982,36 @@ var Types;
787
982
  __decorate([
788
983
  Struct.field(UInt64)
789
984
  ], location_row.prototype, "id", void 0);
985
+ __decorate([
986
+ Struct.field(Name)
987
+ ], location_row.prototype, "owner", void 0);
790
988
  __decorate([
791
989
  Struct.field(coordinates)
792
990
  ], location_row.prototype, "coordinates", void 0);
793
991
  __decorate([
794
- Struct.field(UInt64)
795
- ], location_row.prototype, "epoch", void 0);
992
+ Struct.field(UInt32)
993
+ ], location_row.prototype, "cargomass", void 0);
796
994
  __decorate([
797
- Struct.field(UInt16)
798
- ], location_row.prototype, "good_id", void 0);
995
+ Struct.field(cargo_item, { array: true })
996
+ ], location_row.prototype, "cargo", void 0);
799
997
  __decorate([
800
- Struct.field(UInt16)
801
- ], location_row.prototype, "supply", void 0);
998
+ Struct.field(schedule, { optional: true })
999
+ ], location_row.prototype, "schedule", void 0);
802
1000
  location_row = __decorate([
803
1001
  Struct.type('location_row')
804
1002
  ], location_row);
805
1003
  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 {
1004
+ let nearby_system = class nearby_system extends Struct {
816
1005
  };
817
1006
  __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);
1007
+ Struct.field(UInt64)
1008
+ ], nearby_system.prototype, "distance", void 0);
823
1009
  __decorate([
824
1010
  Struct.field(UInt64)
825
- ], resolve_log.prototype, "entity_id", void 0);
1011
+ ], nearby_system.prototype, "energy_cost", void 0);
826
1012
  __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
- let nearby_system = class nearby_system extends Struct {
870
- };
871
- __decorate([
872
- Struct.field(UInt64)
873
- ], nearby_system.prototype, "distance", void 0);
874
- __decorate([
875
- Struct.field(UInt64)
876
- ], nearby_system.prototype, "energy_cost", void 0);
877
- __decorate([
878
- Struct.field(UInt32)
879
- ], nearby_system.prototype, "flight_time", void 0);
1013
+ Struct.field(UInt32)
1014
+ ], nearby_system.prototype, "flight_time", void 0);
880
1015
  __decorate([
881
1016
  Struct.field(location_info)
882
1017
  ], nearby_system.prototype, "location", void 0);
@@ -890,10 +1025,10 @@ var Types;
890
1025
  Struct.field('bool')
891
1026
  ], nearby_info.prototype, "can_travel", void 0);
892
1027
  __decorate([
893
- Struct.field(entity_state)
1028
+ Struct.field(entity_current_state)
894
1029
  ], nearby_info.prototype, "current", void 0);
895
1030
  __decorate([
896
- Struct.field(entity_state)
1031
+ Struct.field(entity_current_state)
897
1032
  ], nearby_info.prototype, "projected", void 0);
898
1033
  __decorate([
899
1034
  Struct.field(UInt16)
@@ -905,6 +1040,63 @@ var Types;
905
1040
  Struct.type('nearby_info')
906
1041
  ], nearby_info);
907
1042
  Types.nearby_info = nearby_info;
1043
+ let task_event = class task_event extends Struct {
1044
+ };
1045
+ __decorate([
1046
+ Struct.field(UInt8)
1047
+ ], task_event.prototype, "event_type", void 0);
1048
+ __decorate([
1049
+ Struct.field(Name)
1050
+ ], task_event.prototype, "owner", void 0);
1051
+ __decorate([
1052
+ Struct.field(Name)
1053
+ ], task_event.prototype, "entity_type", void 0);
1054
+ __decorate([
1055
+ Struct.field(UInt64)
1056
+ ], task_event.prototype, "entity_id", void 0);
1057
+ __decorate([
1058
+ Struct.field(UInt8)
1059
+ ], task_event.prototype, "task_index", void 0);
1060
+ __decorate([
1061
+ Struct.field(task)
1062
+ ], task_event.prototype, "task", void 0);
1063
+ __decorate([
1064
+ Struct.field(TimePoint)
1065
+ ], task_event.prototype, "starts_at", void 0);
1066
+ __decorate([
1067
+ Struct.field(TimePoint)
1068
+ ], task_event.prototype, "completes_at", void 0);
1069
+ __decorate([
1070
+ Struct.field(UInt16, { optional: true })
1071
+ ], task_event.prototype, "new_energy", void 0);
1072
+ __decorate([
1073
+ Struct.field(coordinates, { optional: true })
1074
+ ], task_event.prototype, "new_coordinates", void 0);
1075
+ __decorate([
1076
+ Struct.field(Int64)
1077
+ ], task_event.prototype, "cargomass_delta", void 0);
1078
+ __decorate([
1079
+ Struct.field(cargo_item, { array: true })
1080
+ ], task_event.prototype, "cargo_added", void 0);
1081
+ __decorate([
1082
+ Struct.field(cargo_item, { array: true })
1083
+ ], task_event.prototype, "cargo_removed", void 0);
1084
+ __decorate([
1085
+ Struct.field(Int64, { optional: true })
1086
+ ], task_event.prototype, "credits", void 0);
1087
+ task_event = __decorate([
1088
+ Struct.type('task_event')
1089
+ ], task_event);
1090
+ Types.task_event = task_event;
1091
+ let notify = class notify extends Struct {
1092
+ };
1093
+ __decorate([
1094
+ Struct.field(task_event)
1095
+ ], notify.prototype, "event", void 0);
1096
+ notify = __decorate([
1097
+ Struct.type('notify')
1098
+ ], notify);
1099
+ Types.notify = notify;
908
1100
  let payloan = class payloan extends Struct {
909
1101
  };
910
1102
  __decorate([
@@ -946,12 +1138,18 @@ var Types;
946
1138
  __decorate([
947
1139
  Struct.field(UInt64)
948
1140
  ], player_info.prototype, "next_warehouse_price", void 0);
1141
+ __decorate([
1142
+ Struct.field(UInt64)
1143
+ ], player_info.prototype, "next_container_price", void 0);
949
1144
  __decorate([
950
1145
  Struct.field(UInt64)
951
1146
  ], player_info.prototype, "ship_count", void 0);
952
1147
  __decorate([
953
1148
  Struct.field(UInt64)
954
1149
  ], player_info.prototype, "warehouse_count", void 0);
1150
+ __decorate([
1151
+ Struct.field(UInt64)
1152
+ ], player_info.prototype, "container_count", void 0);
955
1153
  player_info = __decorate([
956
1154
  Struct.type('player_info')
957
1155
  ], player_info);
@@ -1003,6 +1201,9 @@ var Types;
1003
1201
  __decorate([
1004
1202
  Struct.field(UInt64)
1005
1203
  ], resolve.prototype, "id", void 0);
1204
+ __decorate([
1205
+ Struct.field(UInt64, { optional: true })
1206
+ ], resolve.prototype, "count", void 0);
1006
1207
  resolve = __decorate([
1007
1208
  Struct.type('resolve')
1008
1209
  ], resolve);
@@ -1021,6 +1222,12 @@ var Types;
1021
1222
  __decorate([
1022
1223
  Struct.field(TimePoint, { optional: true })
1023
1224
  ], resolve_results.prototype, "new_schedule_started", void 0);
1225
+ __decorate([
1226
+ Struct.field(UInt64, { optional: true })
1227
+ ], resolve_results.prototype, "entitygroup", void 0);
1228
+ __decorate([
1229
+ Struct.field(entity_ref, { array: true, optional: true })
1230
+ ], resolve_results.prototype, "group_members", void 0);
1024
1231
  resolve_results = __decorate([
1025
1232
  Struct.type('resolve_results')
1026
1233
  ], resolve_results);
@@ -1036,9 +1243,12 @@ var Types;
1036
1243
  Types.salt = salt;
1037
1244
  let sellgoods = class sellgoods extends Struct {
1038
1245
  };
1246
+ __decorate([
1247
+ Struct.field(Name)
1248
+ ], sellgoods.prototype, "entity_type", void 0);
1039
1249
  __decorate([
1040
1250
  Struct.field(UInt64)
1041
- ], sellgoods.prototype, "ship_id", void 0);
1251
+ ], sellgoods.prototype, "id", void 0);
1042
1252
  __decorate([
1043
1253
  Struct.field(UInt16)
1044
1254
  ], sellgoods.prototype, "good_id", void 0);
@@ -1061,6 +1271,15 @@ var Types;
1061
1271
  Struct.type('sequence_row')
1062
1272
  ], sequence_row);
1063
1273
  Types.sequence_row = sequence_row;
1274
+ let trade_stats = class trade_stats extends Struct {
1275
+ };
1276
+ __decorate([
1277
+ Struct.field(UInt16)
1278
+ ], trade_stats.prototype, "margin", void 0);
1279
+ trade_stats = __decorate([
1280
+ Struct.type('trade_stats')
1281
+ ], trade_stats);
1282
+ Types.trade_stats = trade_stats;
1064
1283
  let ship_row = class ship_row extends Struct {
1065
1284
  };
1066
1285
  __decorate([
@@ -1074,16 +1293,19 @@ var Types;
1074
1293
  ], ship_row.prototype, "name", void 0);
1075
1294
  __decorate([
1076
1295
  Struct.field(coordinates)
1077
- ], ship_row.prototype, "location", void 0);
1296
+ ], ship_row.prototype, "coordinates", void 0);
1078
1297
  __decorate([
1079
1298
  Struct.field(UInt32)
1080
- ], ship_row.prototype, "mass", void 0);
1299
+ ], ship_row.prototype, "hullmass", void 0);
1081
1300
  __decorate([
1082
1301
  Struct.field(UInt32)
1083
1302
  ], ship_row.prototype, "capacity", void 0);
1084
1303
  __decorate([
1085
1304
  Struct.field(UInt16)
1086
1305
  ], ship_row.prototype, "energy", void 0);
1306
+ __decorate([
1307
+ Struct.field(UInt32)
1308
+ ], ship_row.prototype, "cargomass", void 0);
1087
1309
  __decorate([
1088
1310
  Struct.field(movement_stats)
1089
1311
  ], ship_row.prototype, "engines", void 0);
@@ -1093,6 +1315,12 @@ var Types;
1093
1315
  __decorate([
1094
1316
  Struct.field(loader_stats)
1095
1317
  ], ship_row.prototype, "loaders", void 0);
1318
+ __decorate([
1319
+ Struct.field(trade_stats, { optional: true })
1320
+ ], ship_row.prototype, "trade", void 0);
1321
+ __decorate([
1322
+ Struct.field(extractor_stats, { optional: true })
1323
+ ], ship_row.prototype, "extractor", void 0);
1096
1324
  __decorate([
1097
1325
  Struct.field(schedule, { optional: true })
1098
1326
  ], ship_row.prototype, "schedule", void 0);
@@ -1100,6 +1328,21 @@ var Types;
1100
1328
  Struct.type('ship_row')
1101
1329
  ], ship_row);
1102
1330
  Types.ship_row = ship_row;
1331
+ let starter_info = class starter_info extends Struct {
1332
+ };
1333
+ __decorate([
1334
+ Struct.field(UInt64)
1335
+ ], starter_info.prototype, "balance", void 0);
1336
+ __decorate([
1337
+ Struct.field(UInt64)
1338
+ ], starter_info.prototype, "debt", void 0);
1339
+ __decorate([
1340
+ Struct.field(entity_info)
1341
+ ], starter_info.prototype, "ship", void 0);
1342
+ starter_info = __decorate([
1343
+ Struct.type('starter_info')
1344
+ ], starter_info);
1345
+ Types.starter_info = starter_info;
1103
1346
  let state_row = class state_row extends Struct {
1104
1347
  };
1105
1348
  __decorate([
@@ -1124,6 +1367,27 @@ var Types;
1124
1367
  Struct.type('state_row')
1125
1368
  ], state_row);
1126
1369
  Types.state_row = state_row;
1370
+ let supply_row = class supply_row extends Struct {
1371
+ };
1372
+ __decorate([
1373
+ Struct.field(UInt64)
1374
+ ], supply_row.prototype, "id", void 0);
1375
+ __decorate([
1376
+ Struct.field(coordinates)
1377
+ ], supply_row.prototype, "coordinates", void 0);
1378
+ __decorate([
1379
+ Struct.field(UInt64)
1380
+ ], supply_row.prototype, "epoch", void 0);
1381
+ __decorate([
1382
+ Struct.field(UInt16)
1383
+ ], supply_row.prototype, "good_id", void 0);
1384
+ __decorate([
1385
+ Struct.field(UInt16)
1386
+ ], supply_row.prototype, "supply", void 0);
1387
+ supply_row = __decorate([
1388
+ Struct.type('supply_row')
1389
+ ], supply_row);
1390
+ Types.supply_row = supply_row;
1127
1391
  let takeloan = class takeloan extends Struct {
1128
1392
  };
1129
1393
  __decorate([
@@ -1198,6 +1462,9 @@ var Types;
1198
1462
  __decorate([
1199
1463
  Struct.field(entity_summary)
1200
1464
  ], types_row.prototype, "entity_summary_type", void 0);
1465
+ __decorate([
1466
+ Struct.field(starter_info)
1467
+ ], types_row.prototype, "starter_info_type", void 0);
1201
1468
  types_row = __decorate([
1202
1469
  Struct.type('types_row')
1203
1470
  ], types_row);
@@ -1239,10 +1506,13 @@ var Types;
1239
1506
  ], warehouse_row.prototype, "name", void 0);
1240
1507
  __decorate([
1241
1508
  Struct.field(coordinates)
1242
- ], warehouse_row.prototype, "location", void 0);
1509
+ ], warehouse_row.prototype, "coordinates", void 0);
1243
1510
  __decorate([
1244
1511
  Struct.field(UInt32)
1245
1512
  ], warehouse_row.prototype, "capacity", void 0);
1513
+ __decorate([
1514
+ Struct.field(UInt32)
1515
+ ], warehouse_row.prototype, "cargomass", void 0);
1246
1516
  __decorate([
1247
1517
  Struct.field(loader_stats)
1248
1518
  ], warehouse_row.prototype, "loaders", void 0);
@@ -1268,11 +1538,14 @@ var Types;
1268
1538
  })(Types || (Types = {}));
1269
1539
  const TableMap = {
1270
1540
  cargo: Types.cargo_row,
1541
+ container: Types.container_row,
1542
+ entitygroup: Types.entitygroup_row,
1271
1543
  location: Types.location_row,
1272
1544
  player: Types.player_row,
1273
1545
  sequence: Types.sequence_row,
1274
1546
  ship: Types.ship_row,
1275
1547
  state: Types.state_row,
1548
+ supply: Types.supply_row,
1276
1549
  types: Types.types_row,
1277
1550
  warehouse: Types.warehouse_row,
1278
1551
  };
@@ -1349,16 +1622,45 @@ const WAREHOUSE_ALREADY_AT_LOCATION = 'Warehouse already exists at this location
1349
1622
  const WAREHOUSE_CAPACITY_EXCEEDED = 'Warehouse capacity would be exceeded.';
1350
1623
 
1351
1624
  const PRECISION = 10000;
1352
- const INITIAL_SHIP_MASS = 500000;
1625
+ const INITIAL_SHIP_GENERATOR_CAPACITY = 350;
1626
+ const INITIAL_SHIP_DRAIN = 25;
1627
+ const INITIAL_SHIP_ENERGY = 350;
1628
+ const INITIAL_SHIP_HULLMASS = 100000;
1629
+ const INITIAL_SHIP_CAPACITY = 500000;
1630
+ const INITIAL_SHIP_Z = 800;
1631
+ const INITIAL_SHIP_RECHARGE = 10;
1632
+ const INITIAL_SHIP_THRUST = 250;
1633
+ const INITIAL_LOADER_MASS = 1000;
1634
+ const INITIAL_LOADER_QUANTITY = 1;
1635
+ const INITIAL_LOADER_THRUST = 1;
1636
+ const WAREHOUSE_Z = 500;
1637
+ const INITIAL_WAREHOUSE_CAPACITY = 10000000;
1638
+ const CONTAINER_Z = 300;
1639
+ const INITIAL_CONTAINER_HULLMASS = 50000;
1640
+ const INITIAL_CONTAINER_CAPACITY = 2000000;
1641
+ const TRAVEL_MAX_DURATION = 86400;
1353
1642
  const MIN_ORBITAL_ALTITUDE = 800;
1354
1643
  const MAX_ORBITAL_ALTITUDE = 3000;
1644
+ const INITIAL_SHIP_MASS = 500000;
1645
+ const INITIAL_EXTRACTOR_RATE = 700;
1646
+ const INITIAL_EXTRACTOR_DRAIN = 2500;
1647
+ const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
1355
1648
  var TaskType;
1356
1649
  (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";
1650
+ TaskType[TaskType["IDLE"] = 0] = "IDLE";
1651
+ TaskType[TaskType["TRAVEL"] = 1] = "TRAVEL";
1652
+ TaskType[TaskType["RECHARGE"] = 2] = "RECHARGE";
1653
+ TaskType[TaskType["LOAD"] = 3] = "LOAD";
1654
+ TaskType[TaskType["UNLOAD"] = 4] = "UNLOAD";
1655
+ TaskType[TaskType["EXTRACT"] = 5] = "EXTRACT";
1361
1656
  })(TaskType || (TaskType = {}));
1657
+ var LocationType;
1658
+ (function (LocationType) {
1659
+ LocationType[LocationType["EMPTY"] = 0] = "EMPTY";
1660
+ LocationType[LocationType["PLANET"] = 1] = "PLANET";
1661
+ LocationType[LocationType["ASTEROID"] = 2] = "ASTEROID";
1662
+ LocationType[LocationType["NEBULA"] = 3] = "NEBULA";
1663
+ })(LocationType || (LocationType = {}));
1362
1664
  var TaskCancelable;
1363
1665
  (function (TaskCancelable) {
1364
1666
  TaskCancelable[TaskCancelable["NEVER"] = 0] = "NEVER";
@@ -1368,6 +1670,7 @@ var TaskCancelable;
1368
1670
  const EntityType = {
1369
1671
  SHIP: Name.from('ship'),
1370
1672
  WAREHOUSE: Name.from('warehouse'),
1673
+ CONTAINER: Name.from('container'),
1371
1674
  };
1372
1675
  class Coordinates extends Types.coordinates {
1373
1676
  static from(value) {
@@ -1377,6 +1680,17 @@ class Coordinates extends Types.coordinates {
1377
1680
  const coords = Coordinates.from(other);
1378
1681
  return this.x.equals(coords.x) && this.y.equals(coords.y);
1379
1682
  }
1683
+ toLocationId() {
1684
+ return coordsToLocationId(this);
1685
+ }
1686
+ }
1687
+ function coordsToLocationId(coords) {
1688
+ const c = Coordinates.from(coords);
1689
+ const mask = BigInt(0xffffffff);
1690
+ const x = BigInt(c.x.toNumber()) & mask;
1691
+ const y = BigInt(c.y.toNumber()) & mask;
1692
+ const id = (x << BigInt(32)) | y;
1693
+ return UInt64.from(id);
1380
1694
  }
1381
1695
  let Good = class Good extends Struct {
1382
1696
  };
@@ -2628,6 +2942,26 @@ var syllables = [
2628
2942
  "Zyn"
2629
2943
  ];
2630
2944
 
2945
+ const LOCATION_EXISTS_THRESHOLD = 0x10;
2946
+ const LOCATION_ACTIVE_THRESHOLD = 0x80;
2947
+ function getLocationType(gameSeed, coordinates) {
2948
+ const seed = Checksum256.from(gameSeed);
2949
+ const str = ['system', coordinates.x, coordinates.y].join('-');
2950
+ const hashResult = hash512(seed, str);
2951
+ if (hashResult.array[0] >= LOCATION_EXISTS_THRESHOLD) {
2952
+ return LocationType.EMPTY;
2953
+ }
2954
+ if (hashResult.array[1] < 96) {
2955
+ return LocationType.PLANET;
2956
+ }
2957
+ else if (hashResult.array[1] < 176) {
2958
+ return LocationType.ASTEROID;
2959
+ }
2960
+ return LocationType.NEBULA;
2961
+ }
2962
+ function isExtractableLocation(locationType) {
2963
+ return locationType === LocationType.ASTEROID || locationType === LocationType.NEBULA;
2964
+ }
2631
2965
  function getSystemName(gameSeed, location) {
2632
2966
  const seed = Checksum256.from(gameSeed);
2633
2967
  if (!hasSystem(seed, location)) {
@@ -2645,9 +2979,82 @@ function getSystemName(gameSeed, location) {
2645
2979
  return name.join('');
2646
2980
  }
2647
2981
  function hasSystem(gameSeed, coordinates) {
2982
+ return getLocationType(gameSeed, coordinates) !== LocationType.EMPTY;
2983
+ }
2984
+ function deriveLocationStatic(gameSeed, coordinates) {
2648
2985
  const seed = Checksum256.from(gameSeed);
2649
- const str = ['system', coordinates.x, coordinates.y].join('-');
2650
- return String(hash512(seed, str)).slice(0, 2) === '00';
2986
+ const coords = Coordinates.from(coordinates);
2987
+ const str = `system-${coords.x}-${coords.y}`;
2988
+ const hashResult = hash512(seed, str);
2989
+ const loc = Types.location_static.from({
2990
+ coords: coords,
2991
+ type: LocationType.EMPTY,
2992
+ subtype: 0,
2993
+ seed0: 0,
2994
+ seed1: 0,
2995
+ });
2996
+ if (hashResult.array[0] >= LOCATION_EXISTS_THRESHOLD) {
2997
+ return loc;
2998
+ }
2999
+ if (hashResult.array[1] < 96) {
3000
+ loc.type = UInt8.from(LocationType.PLANET);
3001
+ }
3002
+ else if (hashResult.array[1] < 176) {
3003
+ loc.type = UInt8.from(LocationType.ASTEROID);
3004
+ }
3005
+ else {
3006
+ loc.type = UInt8.from(LocationType.NEBULA);
3007
+ }
3008
+ loc.subtype = UInt8.from(hashResult.array[2]);
3009
+ loc.seed0 = UInt8.from(hashResult.array[3]);
3010
+ loc.seed1 = UInt8.from(hashResult.array[4]);
3011
+ return loc;
3012
+ }
3013
+ function deriveLocationEpoch(epochSeed, coordinates) {
3014
+ const seed = Checksum256.from(epochSeed);
3015
+ const coords = Coordinates.from(coordinates);
3016
+ const str = `system-epoch-${coords.x}-${coords.y}`;
3017
+ const hashResult = hash512(seed, str);
3018
+ return Types.location_epoch.from({
3019
+ active: hashResult.array[0] < LOCATION_ACTIVE_THRESHOLD,
3020
+ seed0: hashResult.array[1],
3021
+ seed1: hashResult.array[2],
3022
+ });
3023
+ }
3024
+ function deriveLocation(gameSeed, epochSeed, coordinates) {
3025
+ return Types.location_derived.from({
3026
+ static_props: deriveLocationStatic(gameSeed, coordinates),
3027
+ epoch_props: deriveLocationEpoch(epochSeed, coordinates),
3028
+ });
3029
+ }
3030
+ function deriveLocationMixture(location, epochSeed) {
3031
+ const locationType = location.static_props.type.toNumber();
3032
+ if (locationType === LocationType.NEBULA) {
3033
+ return Types.mixture_info.from({
3034
+ components: [{ good_id: 1, purity: PRECISION }],
3035
+ });
3036
+ }
3037
+ if (locationType === LocationType.ASTEROID) {
3038
+ const seed = Checksum256.from(epochSeed);
3039
+ const coords = location.static_props.coords;
3040
+ const str = `mixture-${coords.x}-${coords.y}`;
3041
+ const hashResult = hash512(seed, str);
3042
+ const ironPrimary = location.static_props.subtype.toNumber() % 2 === 0;
3043
+ const purityRange = 0.3;
3044
+ const purityRoll = hashResult.array[0] / 255;
3045
+ const primaryPurity = 0.5 + purityRoll * purityRange;
3046
+ const primaryId = ironPrimary ? 26 : 29;
3047
+ const secondaryId = ironPrimary ? 29 : 26;
3048
+ const primaryAmt = Math.floor(primaryPurity * PRECISION);
3049
+ const secondaryAmt = PRECISION - primaryAmt;
3050
+ return Types.mixture_info.from({
3051
+ components: [
3052
+ { good_id: primaryId, purity: primaryAmt },
3053
+ { good_id: secondaryId, purity: secondaryAmt },
3054
+ ],
3055
+ });
3056
+ }
3057
+ return Types.mixture_info.from({ components: [] });
2651
3058
  }
2652
3059
 
2653
3060
  class GameState extends Types.state_row {
@@ -2752,14 +3159,14 @@ var goodsData = [
2752
3159
  mass: 15000
2753
3160
  },
2754
3161
  {
2755
- id: 2,
3162
+ id: 26,
2756
3163
  name: "Iron",
2757
3164
  description: "A versatile metal used in construction and manufacturing.",
2758
3165
  base_price: 125,
2759
3166
  mass: 40000
2760
3167
  },
2761
3168
  {
2762
- id: 3,
3169
+ id: 29,
2763
3170
  name: "Copper",
2764
3171
  description: "A conductive metal vital for electronics and wiring.",
2765
3172
  base_price: 200,
@@ -2850,7 +3257,7 @@ function calc_flighttime(distance, acceleration) {
2850
3257
  return UInt32.from(2 * Math.sqrt(Number(distance) / acceleration));
2851
3258
  }
2852
3259
  function calc_loader_flighttime(ship, mass, altitude) {
2853
- const z = altitude ?? ship.location.z?.toNumber() ?? calc_orbital_altitude(Number(mass));
3260
+ const z = altitude ?? ship.coordinates.z?.toNumber() ?? calc_orbital_altitude(Number(mass));
2854
3261
  return calc_flighttime(z, calc_loader_acceleration(ship, mass));
2855
3262
  }
2856
3263
  function calc_loader_acceleration(ship, mass) {
@@ -2868,7 +3275,7 @@ function calc_acceleration(thrust, mass) {
2868
3275
  }
2869
3276
  function calc_ship_mass(ship, cargos) {
2870
3277
  const mass = UInt64.from(0);
2871
- mass.add(ship.mass);
3278
+ mass.add(ship.hullmass);
2872
3279
  if (ship.loaders.quantity.gt(UInt32.zero)) {
2873
3280
  mass.add(ship.loaders.mass.multiplying(ship.loaders.quantity));
2874
3281
  }
@@ -2972,17 +3379,56 @@ function estimateTravelTime(ship, travelMass, distance, options = {}) {
2972
3379
  };
2973
3380
  }
2974
3381
  function estimateDealTravelTime(ship, shipMass, distance, loadMass) {
2975
- const needsRecharge = !hasEnergyForDistance(ship, distance);
3382
+ const needsRecharge = !hasEnergyForDistance$1(ship, distance);
2976
3383
  const estimate = estimateTravelTime(ship, shipMass, distance, {
2977
3384
  needsRecharge,
2978
3385
  loadMass,
2979
3386
  });
2980
3387
  return estimate.total;
2981
3388
  }
2982
- function hasEnergyForDistance(ship, distance) {
3389
+ function hasEnergyForDistance$1(ship, distance) {
2983
3390
  const energyNeeded = UInt64.from(distance).dividing(PRECISION).multiplying(ship.engines.drain);
2984
3391
  return UInt64.from(ship.energy).gte(energyNeeded);
2985
3392
  }
3393
+ function getFlightOrigin(entity, flightTaskIndex) {
3394
+ if (!entity.schedule)
3395
+ return entity.coordinates;
3396
+ let origin = entity.coordinates;
3397
+ for (let i = 0; i < flightTaskIndex && i < entity.schedule.tasks.length; i++) {
3398
+ const task = entity.schedule.tasks[i];
3399
+ if (task.type.equals(TaskType.TRAVEL) && task.coordinates) {
3400
+ origin = task.coordinates;
3401
+ }
3402
+ }
3403
+ return origin;
3404
+ }
3405
+ function getDestinationLocation(entity) {
3406
+ if (!entity.schedule)
3407
+ return undefined;
3408
+ for (let i = entity.schedule.tasks.length - 1; i >= 0; i--) {
3409
+ const task = entity.schedule.tasks[i];
3410
+ if (task.type.equals(TaskType.TRAVEL) && task.coordinates) {
3411
+ return task.coordinates;
3412
+ }
3413
+ }
3414
+ return undefined;
3415
+ }
3416
+ function getPositionAt(entity, taskIndex, taskProgress) {
3417
+ if (!entity.schedule || entity.schedule.tasks.length === 0 || taskIndex < 0) {
3418
+ return entity.coordinates;
3419
+ }
3420
+ const task = entity.schedule.tasks[taskIndex];
3421
+ if (!task.type.equals(TaskType.TRAVEL) || !task.coordinates) {
3422
+ return getFlightOrigin(entity, taskIndex);
3423
+ }
3424
+ const origin = getFlightOrigin(entity, taskIndex);
3425
+ const destination = task.coordinates;
3426
+ const interpolated = lerp(origin, destination, taskProgress);
3427
+ return {
3428
+ x: Math.round(interpolated.x),
3429
+ y: Math.round(interpolated.y),
3430
+ };
3431
+ }
2986
3432
  function calc_transfer_duration(source, dest, cargoMass) {
2987
3433
  if (cargoMass === 0) {
2988
3434
  return 0;
@@ -3030,194 +3476,128 @@ function calc_transfer_duration(source, dest, cargoMass) {
3030
3476
  return Math.floor(flightTime / totalQuantity);
3031
3477
  }
3032
3478
 
3033
- class Location {
3034
- constructor(coordinates) {
3035
- this.coordinates = Coordinates.from(coordinates);
3479
+ function capsHasMovement(caps) {
3480
+ return caps.engines !== undefined && caps.generator !== undefined;
3481
+ }
3482
+ function capsHasStorage(caps) {
3483
+ return caps.capacity !== undefined;
3484
+ }
3485
+ function capsHasLoaders(caps) {
3486
+ return caps.loaders !== undefined;
3487
+ }
3488
+ function capsHasTrade(caps) {
3489
+ return caps.trade !== undefined;
3490
+ }
3491
+ function capsHasExtractor(caps) {
3492
+ return caps.extractor !== undefined;
3493
+ }
3494
+ function capsHasMass(caps) {
3495
+ return caps.hullmass !== undefined;
3496
+ }
3497
+
3498
+ function calcCargoMass(entity) {
3499
+ let mass = UInt64.from(0);
3500
+ for (const item of entity.cargo) {
3501
+ const good = getGood(item.good_id);
3502
+ mass = mass.adding(good.mass.multiplying(item.quantity));
3036
3503
  }
3037
- static from(coordinates) {
3038
- return new Location(Coordinates.from(coordinates));
3504
+ return mass;
3505
+ }
3506
+ function calcCargoValue(entity) {
3507
+ let value = UInt64.from(0);
3508
+ for (const item of entity.cargo) {
3509
+ value = value.adding(item.unit_cost.multiplying(item.quantity));
3039
3510
  }
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);
3511
+ return value;
3512
+ }
3513
+ function availableCapacity$1(entity) {
3514
+ const cargoMass = calcCargoMass(entity);
3515
+ return entity.capacity.gt(cargoMass)
3516
+ ? UInt64.from(entity.capacity).subtracting(cargoMass)
3517
+ : UInt64.from(0);
3518
+ }
3519
+ function availableCapacityFromMass(capacity, cargoMass) {
3520
+ const cap = UInt64.from(capacity);
3521
+ const mass = UInt64.from(cargoMass);
3522
+ return cap.gt(mass) ? cap.subtracting(mass) : UInt64.from(0);
3523
+ }
3524
+ function hasSpace$1(entity, goodMass, quantity) {
3525
+ const additional = goodMass.multiplying(quantity);
3526
+ return availableCapacity$1(entity).gte(additional);
3527
+ }
3528
+ function hasSpaceForMass(capacity, currentMass, additionalMass) {
3529
+ return UInt64.from(currentMass).adding(additionalMass).lte(capacity);
3530
+ }
3531
+ function isFull$1(entity) {
3532
+ return UInt64.from(entity.cargomass).gte(entity.capacity);
3533
+ }
3534
+ function isFullFromMass(capacity, cargoMass) {
3535
+ return UInt64.from(cargoMass).gte(capacity);
3536
+ }
3537
+
3538
+ function hasSchedule$1(entity) {
3539
+ return !!entity.schedule && entity.schedule.tasks.length > 0;
3540
+ }
3541
+ function isIdle(entity) {
3542
+ return !hasSchedule$1(entity);
3543
+ }
3544
+ function getTasks(entity) {
3545
+ return entity.schedule?.tasks || [];
3546
+ }
3547
+ function scheduleDuration(entity) {
3548
+ if (!entity.schedule)
3549
+ return 0;
3550
+ return entity.schedule.tasks.reduce((sum, task) => sum + task.duration.toNumber(), 0);
3551
+ }
3552
+ function scheduleElapsed(entity, now) {
3553
+ if (!entity.schedule)
3554
+ return 0;
3555
+ const started = entity.schedule.started.toDate();
3556
+ const elapsed = Math.floor((now.getTime() - started.getTime()) / 1000);
3557
+ return Math.max(0, elapsed);
3558
+ }
3559
+ function scheduleRemaining(entity, now) {
3560
+ if (!entity.schedule)
3561
+ return 0;
3562
+ const duration = scheduleDuration(entity);
3563
+ const elapsed = scheduleElapsed(entity, now);
3564
+ return Math.max(0, duration - elapsed);
3565
+ }
3566
+ function scheduleComplete(entity, now) {
3567
+ return hasSchedule$1(entity) && scheduleRemaining(entity, now) === 0;
3568
+ }
3569
+ function currentTaskIndex(entity, now) {
3570
+ if (!entity.schedule || entity.schedule.tasks.length === 0)
3571
+ return -1;
3572
+ const elapsed = scheduleElapsed(entity, now);
3573
+ let timeAccum = 0;
3574
+ for (let i = 0; i < entity.schedule.tasks.length; i++) {
3575
+ const taskDuration = entity.schedule.tasks[i].duration.toNumber();
3576
+ if (elapsed < timeAccum + taskDuration) {
3577
+ return i;
3045
3578
  }
3046
- return this._hasSystem;
3047
- }
3048
- setMarketPrices(prices) {
3049
- this._marketPrices = prices;
3050
- }
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;
3579
+ timeAccum += taskDuration;
3069
3580
  }
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;
3149
- }
3150
- }
3151
- function toLocation(coords) {
3152
- if (coords instanceof Location) {
3153
- return coords;
3154
- }
3155
- return Location.from(coords);
3156
- }
3157
-
3158
- function hasSchedule(entity) {
3159
- return !!entity.schedule && entity.schedule.tasks.length > 0;
3160
- }
3161
- function isIdle(entity) {
3162
- return !hasSchedule(entity);
3163
- }
3164
- function getTasks(entity) {
3165
- return entity.schedule?.tasks || [];
3166
- }
3167
- function scheduleDuration(entity) {
3168
- if (!entity.schedule)
3169
- return 0;
3170
- return entity.schedule.tasks.reduce((sum, task) => sum + task.duration.toNumber(), 0);
3171
- }
3172
- function scheduleElapsed(entity, now) {
3173
- if (!entity.schedule)
3174
- return 0;
3175
- const started = entity.schedule.started.toDate();
3176
- const elapsed = Math.floor((now.getTime() - started.getTime()) / 1000);
3177
- return Math.max(0, elapsed);
3178
- }
3179
- function scheduleRemaining(entity, now) {
3180
- if (!entity.schedule)
3181
- return 0;
3182
- const duration = scheduleDuration(entity);
3183
- const elapsed = scheduleElapsed(entity, now);
3184
- return Math.max(0, duration - elapsed);
3185
- }
3186
- function scheduleComplete(entity, now) {
3187
- return hasSchedule(entity) && scheduleRemaining(entity, now) === 0;
3188
- }
3189
- function currentTaskIndex(entity, now) {
3190
- if (!entity.schedule || entity.schedule.tasks.length === 0)
3191
- return -1;
3192
- const elapsed = scheduleElapsed(entity, now);
3193
- let timeAccum = 0;
3194
- for (let i = 0; i < entity.schedule.tasks.length; i++) {
3195
- const taskDuration = entity.schedule.tasks[i].duration.toNumber();
3196
- if (elapsed < timeAccum + taskDuration) {
3197
- return i;
3198
- }
3199
- timeAccum += taskDuration;
3200
- }
3201
- return entity.schedule.tasks.length - 1;
3202
- }
3203
- function currentTask(entity, now) {
3204
- const index = currentTaskIndex(entity, now);
3205
- if (index < 0 || !entity.schedule)
3206
- return undefined;
3207
- return entity.schedule.tasks[index];
3208
- }
3209
- function currentTaskType(entity, now) {
3210
- const task = currentTask(entity, now);
3211
- if (!task)
3212
- return undefined;
3213
- return task.type.toNumber();
3214
- }
3215
- function getTaskStartTime(entity, index) {
3216
- if (!entity.schedule || index < 0 || index >= entity.schedule.tasks.length)
3217
- return 0;
3218
- let timeAccum = 0;
3219
- for (let i = 0; i < index; i++) {
3220
- timeAccum += entity.schedule.tasks[i].duration.toNumber();
3581
+ return entity.schedule.tasks.length - 1;
3582
+ }
3583
+ function currentTask(entity, now) {
3584
+ const index = currentTaskIndex(entity, now);
3585
+ if (index < 0 || !entity.schedule)
3586
+ return undefined;
3587
+ return entity.schedule.tasks[index];
3588
+ }
3589
+ function currentTaskType(entity, now) {
3590
+ const task = currentTask(entity, now);
3591
+ if (!task)
3592
+ return undefined;
3593
+ return task.type.toNumber();
3594
+ }
3595
+ function getTaskStartTime(entity, index) {
3596
+ if (!entity.schedule || index < 0 || index >= entity.schedule.tasks.length)
3597
+ return 0;
3598
+ let timeAccum = 0;
3599
+ for (let i = 0; i < index; i++) {
3600
+ timeAccum += entity.schedule.tasks[i].duration.toNumber();
3221
3601
  }
3222
3602
  return timeAccum;
3223
3603
  }
@@ -3267,14 +3647,32 @@ function currentTaskProgress(entity, now) {
3267
3647
  function scheduleProgress(entity, now) {
3268
3648
  const duration = scheduleDuration(entity);
3269
3649
  if (duration === 0)
3270
- return hasSchedule(entity) ? 1 : 0;
3650
+ return hasSchedule$1(entity) ? 1 : 0;
3271
3651
  const elapsed = scheduleElapsed(entity, now);
3272
3652
  return Math.min(1, elapsed / duration);
3273
3653
  }
3654
+ function isTaskType(entity, taskType, now) {
3655
+ return currentTaskType(entity, now) === taskType;
3656
+ }
3657
+ function isInFlight(entity, now) {
3658
+ return isTaskType(entity, TaskType.TRAVEL, now);
3659
+ }
3660
+ function isRecharging(entity, now) {
3661
+ return isTaskType(entity, TaskType.RECHARGE, now);
3662
+ }
3663
+ function isLoading(entity, now) {
3664
+ return isTaskType(entity, TaskType.LOAD, now);
3665
+ }
3666
+ function isUnloading(entity, now) {
3667
+ return isTaskType(entity, TaskType.UNLOAD, now);
3668
+ }
3669
+ function isExtracting(entity, now) {
3670
+ return isTaskType(entity, TaskType.EXTRACT, now);
3671
+ }
3274
3672
 
3275
3673
  var schedule = /*#__PURE__*/Object.freeze({
3276
3674
  __proto__: null,
3277
- hasSchedule: hasSchedule,
3675
+ hasSchedule: hasSchedule$1,
3278
3676
  isIdle: isIdle,
3279
3677
  getTasks: getTasks,
3280
3678
  scheduleDuration: scheduleDuration,
@@ -3290,353 +3688,654 @@ var schedule = /*#__PURE__*/Object.freeze({
3290
3688
  isTaskComplete: isTaskComplete,
3291
3689
  isTaskInProgress: isTaskInProgress,
3292
3690
  currentTaskProgress: currentTaskProgress,
3293
- scheduleProgress: scheduleProgress
3691
+ scheduleProgress: scheduleProgress,
3692
+ isTaskType: isTaskType,
3693
+ isInFlight: isInFlight,
3694
+ isRecharging: isRecharging,
3695
+ isLoading: isLoading,
3696
+ isUnloading: isUnloading,
3697
+ isExtracting: isExtracting
3294
3698
  });
3295
3699
 
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;
3700
+ function getHullMass(entity) {
3701
+ return UInt32.from(entity.hullmass ?? 0);
3702
+ }
3703
+ function createProjectedEntity(entity) {
3704
+ const cargoMass = calcCargoMass(entity);
3705
+ const shipMass = getHullMass(entity);
3706
+ const loaders = entity.loaders;
3707
+ const engines = entity.engines;
3708
+ const generator = entity.generator;
3709
+ const trade = entity.trade;
3710
+ const capacity = entity.capacity;
3711
+ const projected = {
3712
+ location: Coordinates.from(entity.coordinates),
3713
+ energy: UInt16.from(entity.energy ?? 0),
3714
+ cargoMass,
3715
+ shipMass,
3716
+ capacity: capacity ? UInt64.from(capacity) : undefined,
3717
+ engines,
3718
+ generator,
3719
+ loaders,
3720
+ trade,
3721
+ get totalMass() {
3722
+ let mass = UInt64.from(this.shipMass).adding(this.cargoMass);
3723
+ if (this.loaders) {
3724
+ mass = mass.adding(this.loaders.mass.multiplying(this.loaders.quantity));
3725
+ }
3726
+ return mass;
3727
+ },
3728
+ hasMovement() {
3729
+ return capsHasMovement(this.capabilities());
3730
+ },
3731
+ hasStorage() {
3732
+ return capsHasStorage(this.capabilities());
3733
+ },
3734
+ hasLoaders() {
3735
+ return capsHasLoaders(this.capabilities());
3736
+ },
3737
+ hasTrade() {
3738
+ return this.trade !== undefined;
3739
+ },
3740
+ capabilities() {
3741
+ return {
3742
+ hullmass: this.shipMass,
3743
+ capacity: this.capacity ? UInt32.from(this.capacity) : undefined,
3744
+ engines: this.engines,
3745
+ generator: this.generator,
3746
+ loaders: this.loaders,
3747
+ trade: this.trade,
3748
+ };
3749
+ },
3750
+ state() {
3751
+ return {
3752
+ owner: entity.owner ?? Name.from(''),
3753
+ location: Types.coordinates.from(this.location),
3754
+ energy: this.energy,
3755
+ cargomass: UInt32.from(this.cargoMass),
3756
+ cargo: entity.cargo,
3757
+ };
3758
+ },
3759
+ };
3760
+ return projected;
3761
+ }
3762
+ function applyRechargeTask(projected, _task, options) {
3763
+ if (!projected.generator)
3764
+ return;
3765
+ if (options.complete) {
3766
+ projected.energy = UInt16.from(projected.generator.capacity);
3308
3767
  }
3309
- get totalMass() {
3310
- return UInt64.from(this.unitMass).multiplying(this.quantity);
3768
+ else if (options.progress !== undefined) {
3769
+ const capacity = Number(projected.generator.capacity);
3770
+ const currentEnergy = Number(projected.energy);
3771
+ const rechargeAmount = (capacity - currentEnergy) * options.progress;
3772
+ projected.energy = UInt16.from(Math.min(capacity, currentEnergy + rechargeAmount));
3311
3773
  }
3312
- get totalCost() {
3313
- return this.unit_cost.multiplying(this.quantity);
3774
+ }
3775
+ function applyFlightTask(projected, task, options) {
3776
+ if (!task.coordinates || !projected.engines)
3777
+ return;
3778
+ const origin = projected.location;
3779
+ const destination = Coordinates.from(task.coordinates);
3780
+ const distance = distanceBetweenCoordinates(origin, task.coordinates);
3781
+ const energyUsage = distance.dividing(PRECISION).multiplying(projected.engines.drain);
3782
+ if (options.complete) {
3783
+ projected.energy = projected.energy.gt(energyUsage)
3784
+ ? UInt16.from(projected.energy.subtracting(energyUsage))
3785
+ : UInt16.from(0);
3786
+ projected.location = destination;
3314
3787
  }
3315
- get hasCargo() {
3316
- return UInt32.from(this.quantity).gt(UInt32.from(0));
3788
+ else if (options.progress !== undefined) {
3789
+ const interpolated = lerp(origin, destination, options.progress);
3790
+ projected.location = Coordinates.from({
3791
+ x: Math.round(interpolated.x),
3792
+ y: Math.round(interpolated.y),
3793
+ });
3794
+ const partialEnergy = UInt64.from(Math.floor(Number(energyUsage) * options.progress));
3795
+ projected.energy = projected.energy.gt(partialEnergy)
3796
+ ? UInt16.from(projected.energy.subtracting(partialEnergy))
3797
+ : UInt16.from(0);
3317
3798
  }
3318
- get isEmpty() {
3319
- return UInt32.from(this.quantity).equals(UInt32.from(0));
3799
+ }
3800
+ function getGoodMass(good_id) {
3801
+ const good = getGood(good_id);
3802
+ return good.mass;
3803
+ }
3804
+ function applyLoadTask(projected, task) {
3805
+ for (const item of task.cargo) {
3806
+ const good_mass = getGoodMass(item.good_id);
3807
+ projected.cargoMass = projected.cargoMass.adding(good_mass.multiplying(item.quantity));
3320
3808
  }
3321
3809
  }
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);
3810
+ function applyUnloadTask(projected, task) {
3811
+ for (const item of task.cargo) {
3812
+ const good_mass = getGoodMass(item.good_id);
3813
+ const cargoMass = good_mass.multiplying(item.quantity);
3814
+ projected.cargoMass = projected.cargoMass.gt(cargoMass)
3815
+ ? projected.cargoMass.subtracting(cargoMass)
3816
+ : UInt64.from(0);
3346
3817
  }
3347
- get name() {
3348
- return this.entity_name;
3818
+ }
3819
+ function applyExtractTask(projected, task, options) {
3820
+ if (!options.complete)
3821
+ return;
3822
+ if (task.energy_cost) {
3823
+ const energyCost = UInt16.from(task.energy_cost);
3824
+ projected.energy = projected.energy.gt(energyCost)
3825
+ ? UInt16.from(projected.energy.subtracting(energyCost))
3826
+ : UInt16.from(0);
3349
3827
  }
3350
- get inventory() {
3351
- if (!this._inventory) {
3352
- this._inventory = this.cargo.map((item) => new EntityInventory(item));
3353
- }
3354
- return this._inventory;
3828
+ for (const item of task.cargo) {
3829
+ const good_mass = getGoodMass(item.good_id);
3830
+ projected.cargoMass = projected.cargoMass.adding(good_mass.multiplying(item.quantity));
3355
3831
  }
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);
3832
+ }
3833
+ function projectEntity(entity) {
3834
+ const projected = createProjectedEntity(entity);
3835
+ if (!entity.schedule) {
3836
+ return projected;
3362
3837
  }
3363
- get hasSchedule() {
3364
- return hasSchedule(this);
3838
+ for (const task of entity.schedule.tasks) {
3839
+ switch (task.type.toNumber()) {
3840
+ case TaskType.RECHARGE:
3841
+ applyRechargeTask(projected, task, { complete: true });
3842
+ break;
3843
+ case TaskType.TRAVEL:
3844
+ applyFlightTask(projected, task, { complete: true });
3845
+ break;
3846
+ case TaskType.LOAD:
3847
+ applyLoadTask(projected, task);
3848
+ break;
3849
+ case TaskType.UNLOAD:
3850
+ applyUnloadTask(projected, task);
3851
+ break;
3852
+ case TaskType.EXTRACT:
3853
+ applyExtractTask(projected, task, { complete: true });
3854
+ break;
3855
+ }
3856
+ }
3857
+ return projected;
3858
+ }
3859
+ function projectEntityAt(entity, now) {
3860
+ const projected = createProjectedEntity(entity);
3861
+ if (!entity.schedule || entity.schedule.tasks.length === 0) {
3862
+ return projected;
3863
+ }
3864
+ for (let i = 0; i < entity.schedule.tasks.length; i++) {
3865
+ const task = entity.schedule.tasks[i];
3866
+ const taskComplete = isTaskComplete(entity, i, now);
3867
+ const taskInProgress = isTaskInProgress(entity, i, now);
3868
+ if (!taskComplete && !taskInProgress) {
3869
+ break;
3870
+ }
3871
+ const progress = taskInProgress
3872
+ ? getTaskElapsed(entity, i, now) / task.duration.toNumber()
3873
+ : undefined;
3874
+ switch (task.type.toNumber()) {
3875
+ case TaskType.RECHARGE:
3876
+ applyRechargeTask(projected, task, { complete: taskComplete, progress });
3877
+ break;
3878
+ case TaskType.TRAVEL:
3879
+ applyFlightTask(projected, task, { complete: taskComplete, progress });
3880
+ break;
3881
+ case TaskType.LOAD:
3882
+ if (taskComplete) {
3883
+ applyLoadTask(projected, task);
3884
+ }
3885
+ break;
3886
+ case TaskType.UNLOAD:
3887
+ if (taskComplete) {
3888
+ applyUnloadTask(projected, task);
3889
+ }
3890
+ break;
3891
+ case TaskType.EXTRACT:
3892
+ if (taskComplete) {
3893
+ applyExtractTask(projected, task, { complete: true });
3894
+ }
3895
+ break;
3896
+ }
3897
+ }
3898
+ return projected;
3899
+ }
3900
+
3901
+ class Location {
3902
+ constructor(coordinates) {
3903
+ this.coordinates = Coordinates.from(coordinates);
3904
+ }
3905
+ static from(coordinates) {
3906
+ return new Location(Coordinates.from(coordinates));
3907
+ }
3908
+ hasSystemAt(gameSeed) {
3909
+ const seed = Checksum256.from(gameSeed);
3910
+ if (this._hasSystem === undefined || !this._gameSeed?.equals(seed)) {
3911
+ this._gameSeed = seed;
3912
+ this._hasSystem = hasSystem(seed, this.coordinates);
3913
+ }
3914
+ return this._hasSystem;
3915
+ }
3916
+ getLocationTypeAt(gameSeed) {
3917
+ return getLocationType(gameSeed, this.coordinates);
3918
+ }
3919
+ isExtractableAt(gameSeed) {
3920
+ return isExtractableLocation(this.getLocationTypeAt(gameSeed));
3921
+ }
3922
+ setMarketPrices(prices) {
3923
+ this._marketPrices = prices;
3924
+ }
3925
+ get marketPrices() {
3926
+ return this._marketPrices;
3927
+ }
3928
+ getPrice(goodId) {
3929
+ if (!this._marketPrices)
3930
+ return undefined;
3931
+ return this._marketPrices.find((p) => p.id.equals(goodId));
3932
+ }
3933
+ findNearby(gameSeed, maxDistance = 20) {
3934
+ return findNearbyPlanets(Checksum256.from(gameSeed), this.coordinates, maxDistance);
3935
+ }
3936
+ equals(other) {
3937
+ const otherCoords = other instanceof Location ? other.coordinates : Coordinates.from(other);
3938
+ return this.coordinates.equals(otherCoords);
3939
+ }
3940
+ setLocationRows(rows, epoch) {
3941
+ this._locationRows = rows;
3942
+ this._epoch = epoch;
3943
+ }
3944
+ get locationRows() {
3945
+ return this._locationRows;
3946
+ }
3947
+ getSupply(goodId) {
3948
+ if (!this._locationRows)
3949
+ return undefined;
3950
+ const row = this._locationRows.find((r) => r.good_id.equals(goodId) && this._epoch && r.epoch.equals(this._epoch));
3951
+ return row ? row.supply : undefined;
3952
+ }
3953
+ get availableGoods() {
3954
+ if (!this._locationRows)
3955
+ return undefined;
3956
+ return this._locationRows.filter((r) => this._epoch && r.epoch.equals(this._epoch) && r.supply.gt(UInt16.from(0)));
3957
+ }
3958
+ hasGood(goodId) {
3959
+ const supply = this.getSupply(goodId);
3960
+ return supply !== undefined && supply.gt(UInt16.from(0));
3961
+ }
3962
+ get epoch() {
3963
+ return this._epoch;
3964
+ }
3965
+ get hasCachedData() {
3966
+ return this._marketPrices !== undefined || this._locationRows !== undefined;
3967
+ }
3968
+ get hasSupplyData() {
3969
+ return this._locationRows !== undefined;
3970
+ }
3971
+ clearCache() {
3972
+ this._marketPrices = undefined;
3973
+ this._locationRows = undefined;
3974
+ this._epoch = undefined;
3975
+ }
3976
+ withUpdatedSupply(goodId, quantityDelta) {
3977
+ const newLocation = Location.from(this.coordinates);
3978
+ if (this._marketPrices) {
3979
+ newLocation._marketPrices = this._marketPrices.map((price) => {
3980
+ if (price.id.equals(goodId)) {
3981
+ const currentSupply = UInt16.from(price.supply);
3982
+ const delta = UInt16.from(Math.abs(quantityDelta));
3983
+ const newSupply = quantityDelta < 0
3984
+ ? currentSupply.gte(delta)
3985
+ ? currentSupply.subtracting(delta)
3986
+ : UInt16.from(0)
3987
+ : currentSupply.adding(quantityDelta);
3988
+ return GoodPrice.from({
3989
+ id: price.id,
3990
+ good: price.good,
3991
+ price: price.price,
3992
+ supply: newSupply,
3993
+ });
3994
+ }
3995
+ return price;
3996
+ });
3997
+ }
3998
+ if (this._locationRows && this._epoch) {
3999
+ newLocation._locationRows = this._locationRows.map((row) => {
4000
+ if (row.good_id.equals(goodId) && row.epoch.equals(this._epoch)) {
4001
+ const currentSupply = UInt16.from(row.supply);
4002
+ const delta = UInt16.from(Math.abs(quantityDelta));
4003
+ const newSupply = quantityDelta < 0
4004
+ ? currentSupply.gte(delta)
4005
+ ? currentSupply.subtracting(delta)
4006
+ : UInt16.from(0)
4007
+ : currentSupply.adding(quantityDelta);
4008
+ return Types.supply_row.from({
4009
+ id: row.id,
4010
+ coordinates: row.coordinates,
4011
+ epoch: row.epoch,
4012
+ good_id: row.good_id,
4013
+ supply: newSupply,
4014
+ });
4015
+ }
4016
+ return row;
4017
+ });
4018
+ newLocation._epoch = this._epoch;
4019
+ }
4020
+ newLocation._gameSeed = this._gameSeed;
4021
+ newLocation._hasSystem = this._hasSystem;
4022
+ return newLocation;
4023
+ }
4024
+ }
4025
+ function toLocation(coords) {
4026
+ if (coords instanceof Location) {
4027
+ return coords;
4028
+ }
4029
+ return Location.from(coords);
4030
+ }
4031
+
4032
+ class ScheduleAccessor {
4033
+ constructor(entity) {
4034
+ this.entity = entity;
4035
+ }
4036
+ get hasSchedule() {
4037
+ return hasSchedule$1(this.entity);
3365
4038
  }
3366
4039
  get isIdle() {
3367
- return this.is_idle;
4040
+ return isIdle(this.entity);
3368
4041
  }
3369
4042
  get tasks() {
3370
- return getTasks(this);
4043
+ return getTasks(this.entity);
3371
4044
  }
3372
- scheduleDuration() {
3373
- return scheduleDuration(this);
4045
+ duration() {
4046
+ return scheduleDuration(this.entity);
3374
4047
  }
3375
- scheduleElapsed(now) {
3376
- return scheduleElapsed(this, now);
4048
+ elapsed(now) {
4049
+ return scheduleElapsed(this.entity, now);
3377
4050
  }
3378
- scheduleRemaining(now) {
3379
- return scheduleRemaining(this, now);
4051
+ remaining(now) {
4052
+ return scheduleRemaining(this.entity, now);
3380
4053
  }
3381
- scheduleComplete(now) {
3382
- return scheduleComplete(this, now);
4054
+ complete(now) {
4055
+ return scheduleComplete(this.entity, now);
3383
4056
  }
3384
4057
  currentTaskIndex(now) {
3385
- return currentTaskIndex(this, now);
4058
+ return currentTaskIndex(this.entity, now);
3386
4059
  }
3387
4060
  currentTask(now) {
3388
- return currentTask(this, now);
4061
+ return currentTask(this.entity, now);
3389
4062
  }
3390
4063
  currentTaskType(now) {
3391
- return currentTaskType(this, now);
4064
+ return currentTaskType(this.entity, now);
3392
4065
  }
3393
- getTaskStartTime(index) {
3394
- return getTaskStartTime(this, index);
4066
+ taskStartTime(index) {
4067
+ return getTaskStartTime(this.entity, index);
3395
4068
  }
3396
- getTaskElapsed(index, now) {
3397
- return getTaskElapsed(this, index, now);
4069
+ taskElapsed(index, now) {
4070
+ return getTaskElapsed(this.entity, index, now);
3398
4071
  }
3399
- getTaskRemaining(index, now) {
3400
- return getTaskRemaining(this, index, now);
4072
+ taskRemaining(index, now) {
4073
+ return getTaskRemaining(this.entity, index, now);
3401
4074
  }
3402
- isTaskComplete(index, now) {
3403
- return isTaskComplete(this, index, now);
4075
+ taskComplete(index, now) {
4076
+ return isTaskComplete(this.entity, index, now);
3404
4077
  }
3405
- isTaskInProgress(index, now) {
3406
- return isTaskInProgress(this, index, now);
4078
+ taskInProgress(index, now) {
4079
+ return isTaskInProgress(this.entity, index, now);
3407
4080
  }
3408
4081
  currentTaskProgress(now) {
3409
- return currentTaskProgress(this, now);
4082
+ return currentTaskProgress(this.entity, now);
3410
4083
  }
3411
- scheduleProgress(now) {
3412
- return scheduleProgress(this, now);
4084
+ progress(now) {
4085
+ return scheduleProgress(this.entity, now);
3413
4086
  }
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;
3422
- }
4087
+ }
4088
+ function createScheduleAccessor(entity) {
4089
+ return new ScheduleAccessor(entity);
4090
+ }
4091
+
4092
+ class EntityInventory extends Types.cargo_item {
4093
+ get good() {
4094
+ if (!this._good) {
4095
+ this._good = getGood(this.good_id);
3423
4096
  }
3424
- return origin;
4097
+ return this._good;
3425
4098
  }
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
- }
4099
+ get name() {
4100
+ return this.good.name;
4101
+ }
4102
+ get unitMass() {
4103
+ return this.good.mass;
4104
+ }
4105
+ get totalMass() {
4106
+ return UInt64.from(this.unitMass).multiplying(this.quantity);
4107
+ }
4108
+ get totalCost() {
4109
+ return this.unit_cost.multiplying(this.quantity);
4110
+ }
4111
+ get hasCargo() {
4112
+ return UInt32.from(this.quantity).gt(UInt32.from(0));
4113
+ }
4114
+ get isEmpty() {
4115
+ return UInt32.from(this.quantity).equals(UInt32.from(0));
4116
+ }
4117
+ }
4118
+
4119
+ class InventoryAccessor {
4120
+ constructor(entity) {
4121
+ this.entity = entity;
4122
+ }
4123
+ get items() {
4124
+ if (!this._items) {
4125
+ this._items = this.entity.cargo.map((item) => new EntityInventory(item));
3434
4126
  }
3435
- return undefined;
4127
+ return this._items;
3436
4128
  }
3437
- positionAt(now) {
3438
- if (!this.schedule || this.schedule.tasks.length === 0) {
3439
- return this.location;
4129
+ get totalMass() {
4130
+ return this.items.reduce((sum, c) => sum.adding(c.totalMass), UInt64.from(0));
4131
+ }
4132
+ get totalValue() {
4133
+ return this.items.reduce((sum, c) => sum.adding(c.totalCost), UInt64.from(0));
4134
+ }
4135
+ forGood(goodId) {
4136
+ return this.items.find((c) => c.good_id.equals(goodId));
4137
+ }
4138
+ get sellable() {
4139
+ return this.items.filter((c) => c.hasCargo);
4140
+ }
4141
+ get hasSellable() {
4142
+ return this.items.some((c) => c.hasCargo);
4143
+ }
4144
+ get sellableCount() {
4145
+ return this.items.filter((c) => c.hasCargo).length;
4146
+ }
4147
+ }
4148
+ function createInventoryAccessor(entity) {
4149
+ return new InventoryAccessor(entity);
4150
+ }
4151
+
4152
+ function maxTravelDistance(entity) {
4153
+ return UInt32.from(entity.generator.capacity)
4154
+ .dividing(entity.engines.drain)
4155
+ .multiplying(PRECISION);
4156
+ }
4157
+ function calcEnergyUsage(entity, distance) {
4158
+ return distance.dividing(PRECISION).multiplying(entity.engines.drain);
4159
+ }
4160
+ function hasEnergyForDistance(entity, distance) {
4161
+ const usage = calcEnergyUsage(entity, distance);
4162
+ return UInt64.from(entity.energy).gte(usage);
4163
+ }
4164
+ function energyPercent(entity) {
4165
+ return (Number(entity.energy) / Number(entity.generator.capacity)) * 100;
4166
+ }
4167
+ function needsRecharge(entity) {
4168
+ return UInt64.from(entity.energy).lt(entity.generator.capacity);
4169
+ }
4170
+
4171
+ function totalCargoMass(cargo) {
4172
+ return cargo.reduce((sum, c) => {
4173
+ return sum.adding(c.totalMass);
4174
+ }, UInt64.from(0));
4175
+ }
4176
+ function cargoValue(cargo) {
4177
+ return cargo.reduce((sum, c) => {
4178
+ return sum.adding(c.totalCost);
4179
+ }, UInt64.from(0));
4180
+ }
4181
+ function getCargoForGood(cargo, goodId) {
4182
+ return cargo.find((c) => c.good_id.equals(goodId));
4183
+ }
4184
+ function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
4185
+ const additionalMass = goodMass.multiplying(quantity);
4186
+ const totalMass = currentMass.adding(additionalMass);
4187
+ return totalMass.lte(maxCapacity);
4188
+ }
4189
+ function availableCapacity(currentMass, maxCapacity) {
4190
+ if (currentMass.gte(maxCapacity)) {
4191
+ return UInt64.from(0);
4192
+ }
4193
+ return maxCapacity.subtracting(currentMass);
4194
+ }
4195
+ function isFull(currentMass, maxCapacity) {
4196
+ return currentMass.gte(maxCapacity);
4197
+ }
4198
+ function calculateSaleValue(cargo, prices) {
4199
+ if (cargo.length === 0) {
4200
+ return { revenue: UInt64.from(0), profit: UInt64.from(0), cost: UInt64.from(0) };
4201
+ }
4202
+ let revenue = UInt64.from(0);
4203
+ let cost = UInt64.from(0);
4204
+ for (const item of cargo) {
4205
+ if (UInt32.from(item.quantity).equals(UInt32.from(0)))
4206
+ continue;
4207
+ const goodId = Number(item.good_id);
4208
+ const salePrice = prices.get(goodId);
4209
+ if (salePrice) {
4210
+ revenue = revenue.adding(salePrice.multiplying(item.quantity));
3440
4211
  }
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);
4212
+ cost = cost.adding(item.unit_cost.multiplying(item.quantity));
4213
+ }
4214
+ const profit = revenue.gte(cost) ? revenue.subtracting(cost) : UInt64.from(0);
4215
+ return {
4216
+ revenue,
4217
+ profit,
4218
+ cost,
4219
+ };
4220
+ }
4221
+ function calculateSaleValueFromArray(cargo, prices) {
4222
+ const priceMap = new Map();
4223
+ prices.forEach((price, index) => {
4224
+ priceMap.set(index, price);
4225
+ });
4226
+ return calculateSaleValue(cargo, priceMap);
4227
+ }
4228
+ function afterSellGoods(cargo, goodsToSell) {
4229
+ if (cargo.length === 0) {
4230
+ return [];
4231
+ }
4232
+ return cargo.map((item) => {
4233
+ const saleItem = goodsToSell.find((s) => Number(item.good_id) === s.goodId);
4234
+ if (!saleItem) {
4235
+ return new EntityInventory(item);
3447
4236
  }
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({
3453
- x: Math.round(interpolated.x),
3454
- y: Math.round(interpolated.y),
3455
- });
4237
+ const currentQty = Number(item.quantity);
4238
+ const newQty = Math.max(0, currentQty - saleItem.quantity);
4239
+ return new EntityInventory(Types.cargo_item.from({
4240
+ good_id: item.good_id,
4241
+ quantity: UInt32.from(newQty),
4242
+ unit_cost: item.unit_cost,
4243
+ }));
4244
+ });
4245
+ }
4246
+ function afterSellAllGoods(cargo) {
4247
+ if (cargo.length === 0) {
4248
+ return [];
4249
+ }
4250
+ return cargo.map((item) => new EntityInventory(Types.cargo_item.from({
4251
+ good_id: item.good_id,
4252
+ quantity: UInt32.from(0),
4253
+ unit_cost: item.unit_cost,
4254
+ })));
4255
+ }
4256
+
4257
+ var cargoUtils = /*#__PURE__*/Object.freeze({
4258
+ __proto__: null,
4259
+ totalCargoMass: totalCargoMass,
4260
+ cargoValue: cargoValue,
4261
+ getCargoForGood: getCargoForGood,
4262
+ hasSpace: hasSpace,
4263
+ availableCapacity: availableCapacity,
4264
+ isFull: isFull,
4265
+ calculateSaleValue: calculateSaleValue,
4266
+ calculateSaleValueFromArray: calculateSaleValueFromArray,
4267
+ afterSellGoods: afterSellGoods,
4268
+ afterSellAllGoods: afterSellAllGoods
4269
+ });
4270
+
4271
+ class Ship extends Types.entity_info {
4272
+ get name() {
4273
+ return this.entity_name;
4274
+ }
4275
+ get inv() {
4276
+ return (this._inv ?? (this._inv = new InventoryAccessor(this)));
4277
+ }
4278
+ get inventory() {
4279
+ return this.inv.items;
4280
+ }
4281
+ get sched() {
4282
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
4283
+ }
4284
+ get maxDistance() {
4285
+ if (!this.generator || !this.engines)
4286
+ return UInt32.from(0);
4287
+ return maxTravelDistance(this);
4288
+ }
4289
+ get isIdle() {
4290
+ return this.is_idle;
4291
+ }
4292
+ getFlightOrigin(flightTaskIndex) {
4293
+ return Coordinates.from(getFlightOrigin(this, flightTaskIndex));
4294
+ }
4295
+ destinationLocation() {
4296
+ const dest = getDestinationLocation(this);
4297
+ return dest ? Coordinates.from(dest) : undefined;
4298
+ }
4299
+ positionAt(now) {
4300
+ const taskIndex = this.sched.currentTaskIndex(now);
4301
+ const progress = this.sched.currentTaskProgress(now);
4302
+ return Coordinates.from(getPositionAt(this, taskIndex, progress));
3456
4303
  }
3457
4304
  isInFlight(now) {
3458
- const taskType = this.currentTaskType(now);
3459
- return taskType === TaskType.FLIGHT;
4305
+ return isInFlight(this, now);
3460
4306
  }
3461
4307
  isRecharging(now) {
3462
- const taskType = this.currentTaskType(now);
3463
- return taskType === TaskType.RECHARGE;
4308
+ return isRecharging(this, now);
3464
4309
  }
3465
4310
  isLoading(now) {
3466
- const taskType = this.currentTaskType(now);
3467
- return taskType === TaskType.LOAD;
4311
+ return isLoading(this, now);
3468
4312
  }
3469
4313
  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;
4314
+ return isUnloading(this, now);
3480
4315
  }
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
- };
4316
+ isExtracting(now) {
4317
+ return isExtracting(this, now);
4318
+ }
4319
+ get hasExtractor() {
4320
+ return this.extractor !== undefined;
3500
4321
  }
3501
4322
  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
- }
3545
- }
3546
- return projected;
4323
+ return projectEntity(this);
3547
4324
  }
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;
3553
- }
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) {
3559
- 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;
3604
- }
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
- }
3625
- }
3626
- return projected;
4325
+ projectAt(now) {
4326
+ return projectEntityAt(this, now);
3627
4327
  }
3628
- get currentLocation() {
3629
- return this.location;
4328
+ get location() {
4329
+ return Location.from(this.coordinates);
3630
4330
  }
3631
4331
  get totalCargoMass() {
3632
- return this.inventory.reduce((sum, c) => sum.adding(c.totalMass), UInt64.from(0));
4332
+ return this.inv.totalMass;
3633
4333
  }
3634
4334
  get cargoValue() {
3635
- return this.inventory.reduce((sum, c) => sum.adding(c.totalCost), UInt64.from(0));
4335
+ return this.inv.totalValue;
3636
4336
  }
3637
4337
  get totalMass() {
3638
- const cargoMass = this.totalCargoMass;
3639
- let mass = UInt64.from(this.mass ?? 0).adding(cargoMass);
4338
+ let mass = UInt64.from(this.hullmass ?? 0).adding(this.totalCargoMass);
3640
4339
  if (this.loaders) {
3641
4340
  mass = mass.adding(UInt64.from(this.loaders.mass).multiplying(this.loaders.quantity));
3642
4341
  }
@@ -3646,263 +4345,146 @@ class Ship extends Types.entity_info {
3646
4345
  return UInt64.from(this.capacity);
3647
4346
  }
3648
4347
  hasSpace(goodMass, quantity) {
3649
- const additionalMass = goodMass.multiplying(quantity);
3650
- const newTotal = this.totalMass.adding(additionalMass);
3651
- return newTotal.lte(this.maxCapacity);
4348
+ return this.totalMass.adding(goodMass.multiplying(quantity)).lte(this.maxCapacity);
3652
4349
  }
3653
4350
  get availableCapacity() {
3654
- if (this.totalMass.gte(this.maxCapacity)) {
3655
- return UInt64.from(0);
3656
- }
3657
- return this.maxCapacity.subtracting(this.totalMass);
3658
- }
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;
4351
+ return this.totalMass.gte(this.maxCapacity)
4352
+ ? UInt64.from(0)
4353
+ : this.maxCapacity.subtracting(this.totalMass);
3667
4354
  }
3668
4355
  getCargoForGood(goodId) {
3669
- return this.inventory.find((c) => c.good_id.equals(goodId));
4356
+ return this.inv.forGood(goodId);
3670
4357
  }
3671
4358
  get sellableCargo() {
3672
- return this.inventory.filter((c) => c.hasCargo);
4359
+ return this.inv.sellable;
3673
4360
  }
3674
4361
  get hasSellableCargo() {
3675
- return this.inventory.some((c) => c.hasCargo);
4362
+ return this.inv.hasSellable;
3676
4363
  }
3677
4364
  get sellableGoodsCount() {
3678
- return this.inventory.filter((c) => c.hasCargo).length;
4365
+ return this.inv.sellableCount;
3679
4366
  }
3680
4367
  get isFull() {
3681
4368
  return this.totalMass.gte(this.maxCapacity);
3682
4369
  }
3683
4370
  get energyPercent() {
3684
- if (!this.generator)
4371
+ if (!this.generator || this.energy === undefined)
3685
4372
  return 0;
3686
- return (Number(this.energy ?? 0) / Number(this.generator.capacity)) * 100;
4373
+ return energyPercent(this);
3687
4374
  }
3688
4375
  get needsRecharge() {
3689
- if (!this.generator)
4376
+ if (!this.generator || this.energy === undefined)
3690
4377
  return false;
3691
- return UInt64.from(this.energy ?? 0).lt(this.generator.capacity);
4378
+ return needsRecharge(this);
3692
4379
  }
3693
4380
  hasEnergyFor(distance) {
3694
- if (!this.engines)
4381
+ if (!this.engines || !this.generator || this.energy === undefined)
3695
4382
  return false;
3696
- const energyNeeded = distance.dividing(PRECISION).multiplying(this.engines.drain);
3697
- return UInt64.from(this.energy ?? 0).gte(energyNeeded);
4383
+ return hasEnergyForDistance(this, distance);
3698
4384
  }
3699
4385
  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
- };
4386
+ return calculateSaleValue(this.cargo, prices);
3721
4387
  }
3722
4388
  calculateSaleValueFromArray(prices) {
3723
- const priceMap = new Map();
3724
- prices.forEach((price, index) => {
3725
- priceMap.set(index, price);
3726
- });
3727
- return this.calculateSaleValue(priceMap);
4389
+ return calculateSaleValueFromArray(this.cargo, prices);
3728
4390
  }
3729
4391
  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
- });
4392
+ return afterSellGoods(this.cargo, goodsToSell);
3746
4393
  }
3747
4394
  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
- })));
4395
+ return afterSellAllGoods(this.cargo);
3756
4396
  }
3757
4397
  }
3758
4398
 
3759
4399
  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
4400
  get name() {
3791
4401
  return this.entity_name;
3792
4402
  }
4403
+ get inv() {
4404
+ return (this._inv ?? (this._inv = new InventoryAccessor(this)));
4405
+ }
3793
4406
  get inventory() {
3794
- if (!this._inventory) {
3795
- this._inventory = this.cargo.map((item) => new EntityInventory(item));
3796
- }
3797
- return this._inventory;
4407
+ return this.inv.items;
3798
4408
  }
3799
- get hasSchedule() {
3800
- return hasSchedule(this);
4409
+ get sched() {
4410
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
3801
4411
  }
3802
4412
  get isIdle() {
3803
4413
  return this.is_idle;
3804
4414
  }
3805
- get tasks() {
3806
- return getTasks(this);
3807
- }
3808
- scheduleDuration() {
3809
- return scheduleDuration(this);
4415
+ isLoading(now) {
4416
+ return isLoading(this, now);
3810
4417
  }
3811
- scheduleElapsed(now) {
3812
- return scheduleElapsed(this, now);
4418
+ isUnloading(now) {
4419
+ return isUnloading(this, now);
3813
4420
  }
3814
- scheduleRemaining(now) {
3815
- return scheduleRemaining(this, now);
4421
+ get location() {
4422
+ return Location.from(this.coordinates);
3816
4423
  }
3817
- scheduleComplete(now) {
3818
- return scheduleComplete(this, now);
4424
+ get totalCargoMass() {
4425
+ return this.inv.totalMass;
3819
4426
  }
3820
- currentTaskIndex(now) {
3821
- return currentTaskIndex(this, now);
4427
+ get cargoValue() {
4428
+ return this.inv.totalValue;
3822
4429
  }
3823
- currentTask(now) {
3824
- return currentTask(this, now);
4430
+ get maxCapacity() {
4431
+ return UInt64.from(this.capacity);
3825
4432
  }
3826
- currentTaskType(now) {
3827
- return currentTaskType(this, now);
4433
+ get availableCapacity() {
4434
+ const cargo = this.totalCargoMass;
4435
+ return cargo.gte(this.maxCapacity) ? UInt64.from(0) : this.maxCapacity.subtracting(cargo);
3828
4436
  }
3829
- getTaskStartTime(index) {
3830
- return getTaskStartTime(this, index);
4437
+ hasSpace(goodMass, quantity) {
4438
+ return this.totalCargoMass.adding(goodMass.multiplying(quantity)).lte(this.maxCapacity);
3831
4439
  }
3832
- getTaskElapsed(index, now) {
3833
- return getTaskElapsed(this, index, now);
4440
+ get isFull() {
4441
+ return this.totalCargoMass.gte(this.maxCapacity);
3834
4442
  }
3835
- getTaskRemaining(index, now) {
3836
- return getTaskRemaining(this, index, now);
4443
+ getCargoForGood(goodId) {
4444
+ return this.inv.forGood(goodId);
3837
4445
  }
3838
- isTaskComplete(index, now) {
3839
- return isTaskComplete(this, index, now);
4446
+ get orbitalAltitude() {
4447
+ return this.coordinates.z?.toNumber() || 0;
3840
4448
  }
3841
- isTaskInProgress(index, now) {
3842
- return isTaskInProgress(this, index, now);
4449
+ }
4450
+
4451
+ class Container extends Types.entity_info {
4452
+ get name() {
4453
+ return this.entity_name;
3843
4454
  }
3844
- currentTaskProgress(now) {
3845
- return currentTaskProgress(this, now);
4455
+ get sched() {
4456
+ return (this._sched ?? (this._sched = new ScheduleAccessor(this)));
3846
4457
  }
3847
- scheduleProgress(now) {
3848
- return scheduleProgress(this, now);
4458
+ get isIdle() {
4459
+ return this.is_idle;
3849
4460
  }
3850
4461
  isLoading(now) {
3851
- const taskType = this.currentTaskType(now);
3852
- return taskType === TaskType.LOAD;
4462
+ return isLoading(this, now);
3853
4463
  }
3854
4464
  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;
4465
+ return isUnloading(this, now);
3865
4466
  }
3866
- get currentLocation() {
3867
- return this.location;
4467
+ get location() {
4468
+ return Location.from(this.coordinates);
3868
4469
  }
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));
4470
+ get totalMass() {
4471
+ return UInt64.from(this.hullmass ?? 0).adding(this.cargomass);
3874
4472
  }
3875
4473
  get maxCapacity() {
3876
4474
  return UInt64.from(this.capacity);
3877
4475
  }
3878
4476
  get availableCapacity() {
3879
- if (this.totalCargoMass.gte(this.maxCapacity)) {
3880
- return UInt64.from(0);
3881
- }
3882
- return this.maxCapacity.subtracting(this.totalCargoMass);
4477
+ const cargo = UInt64.from(this.cargomass);
4478
+ return cargo.gte(this.maxCapacity) ? UInt64.from(0) : this.maxCapacity.subtracting(cargo);
3883
4479
  }
3884
- hasSpace(goodMass, quantity) {
3885
- const additionalMass = goodMass.multiplying(quantity);
3886
- const newTotal = this.totalCargoMass.adding(additionalMass);
3887
- return newTotal.lte(this.maxCapacity);
4480
+ hasSpace(additionalMass) {
4481
+ return UInt64.from(this.cargomass).adding(additionalMass).lte(this.maxCapacity);
3888
4482
  }
3889
4483
  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));
4484
+ return UInt64.from(this.cargomass).gte(this.maxCapacity);
3903
4485
  }
3904
4486
  get orbitalAltitude() {
3905
- return this.location.z?.toNumber() || 0;
4487
+ return this.coordinates.z?.toNumber() || 0;
3906
4488
  }
3907
4489
  }
3908
4490
 
@@ -3938,25 +4520,37 @@ class EntitiesManager extends BaseManager {
3938
4520
  async getWarehouse(id) {
3939
4521
  return (await this.getEntity('warehouse', id));
3940
4522
  }
4523
+ async getContainer(id) {
4524
+ return (await this.getEntity('container', id));
4525
+ }
3941
4526
  async getShips(owner) {
3942
4527
  return (await this.getEntities(owner, 'ship'));
3943
4528
  }
3944
4529
  async getWarehouses(owner) {
3945
4530
  return (await this.getEntities(owner, 'warehouse'));
3946
4531
  }
4532
+ async getContainers(owner) {
4533
+ return (await this.getEntities(owner, 'container'));
4534
+ }
3947
4535
  async getShipSummaries(owner) {
3948
4536
  return this.getSummaries(owner, 'ship');
3949
4537
  }
3950
4538
  async getWarehouseSummaries(owner) {
3951
4539
  return this.getSummaries(owner, 'warehouse');
3952
4540
  }
4541
+ async getContainerSummaries(owner) {
4542
+ return this.getSummaries(owner, 'container');
4543
+ }
3953
4544
  wrapEntity(entity) {
3954
4545
  if (entity.type.equals('ship')) {
3955
4546
  return new Ship(entity);
3956
4547
  }
3957
- else {
4548
+ else if (entity.type.equals('warehouse')) {
3958
4549
  return new Warehouse(entity);
3959
4550
  }
4551
+ else {
4552
+ return new Container(entity);
4553
+ }
3960
4554
  }
3961
4555
  resolveOwner(owner) {
3962
4556
  if (typeof owner === 'object' && owner !== null && 'owner' in owner) {
@@ -4096,7 +4690,7 @@ class Player extends Types.player_row {
4096
4690
  }
4097
4691
  }
4098
4692
  Player.MAX_LOAN = 1000000;
4099
- Player.BASE_SHIP_COST = 100;
4693
+ Player.BASE_SHIP_COST = 500;
4100
4694
  Player.SHIP_COST_MULTIPLIER = 5;
4101
4695
 
4102
4696
  class PlayersManager extends BaseManager {
@@ -4253,9 +4847,10 @@ function getSupply(gameSeed, state, location, goodId) {
4253
4847
  const r = roll(gameSeed, seed);
4254
4848
  const percent = r / 65535;
4255
4849
  const epoch = 1 + Number(state.epoch) / 90;
4256
- const ship = Math.pow(Number(state.ships), 0);
4850
+ const ship = 1;
4257
4851
  const goodIdNum = Number(goodId);
4258
- return Math.floor((128 / goodIdNum) * percent * ship * epoch);
4852
+ const base = Math.floor(128 / goodIdNum);
4853
+ return Math.floor(base * percent * ship * epoch);
4259
4854
  }
4260
4855
  function marketPrice(location, goodId, gameSeed, state) {
4261
4856
  const good = getGood(goodId);
@@ -4288,14 +4883,14 @@ class LocationsManager extends BaseManager {
4288
4883
  return marketPrices(location, game.config.seed, state);
4289
4884
  }
4290
4885
  async getMarketPricesWithSupply(location) {
4291
- const [game, state, locationRows] = await Promise.all([
4886
+ const [game, state, supplyRows] = await Promise.all([
4292
4887
  this.getGame(),
4293
4888
  this.getState(),
4294
- this.getLocation(location),
4889
+ this.getSupplyRows(location),
4295
4890
  ]);
4296
4891
  const prices = marketPrices(location, game.config.seed, state);
4297
4892
  const supplyMap = new Map();
4298
- for (const row of locationRows) {
4893
+ for (const row of supplyRows) {
4299
4894
  if (UInt64.from(row.epoch).equals(state.epoch)) {
4300
4895
  supplyMap.set(Number(row.good_id), Number(row.supply));
4301
4896
  }
@@ -4321,9 +4916,9 @@ class LocationsManager extends BaseManager {
4321
4916
  const game = await this.getGame();
4322
4917
  return findNearbyPlanets(game.config.seed, origin, maxDistance);
4323
4918
  }
4324
- async getLocation(location) {
4919
+ async getSupplyRows(location) {
4325
4920
  const hash = Checksum256.hash(Bytes.from(`${location.x}-${location.y}`, 'utf8'));
4326
- return this.server.table('location').all({
4921
+ return this.server.table('supply').all({
4327
4922
  index_position: 'secondary',
4328
4923
  from: hash,
4329
4924
  to: hash,
@@ -4338,7 +4933,7 @@ class LocationsManager extends BaseManager {
4338
4933
  async getLocationWithSupply(coords) {
4339
4934
  const location = toLocation(coords);
4340
4935
  const [rows, state] = await Promise.all([
4341
- this.getLocation(location.coordinates),
4936
+ this.getSupplyRows(location.coordinates),
4342
4937
  this.getState(),
4343
4938
  ]);
4344
4939
  location.setLocationRows(rows, state.epoch);
@@ -4348,13 +4943,24 @@ class LocationsManager extends BaseManager {
4348
4943
  const location = toLocation(coords);
4349
4944
  const [prices, rows, state] = await Promise.all([
4350
4945
  this.getMarketPrices(location.coordinates),
4351
- this.getLocation(location.coordinates),
4946
+ this.getSupplyRows(location.coordinates),
4352
4947
  this.getState(),
4353
4948
  ]);
4354
4949
  location.setMarketPrices(prices);
4355
4950
  location.setLocationRows(rows, state.epoch);
4356
4951
  return location;
4357
4952
  }
4953
+ async getLocationEntity(id) {
4954
+ const row = await this.server.table('location').get(UInt64.from(id));
4955
+ return row ?? undefined;
4956
+ }
4957
+ async getLocationEntityAt(coords) {
4958
+ const id = coordsToLocationId(coords);
4959
+ return this.getLocationEntity(id);
4960
+ }
4961
+ async getAllLocationEntities() {
4962
+ return this.server.table('location').all();
4963
+ }
4358
4964
  }
4359
4965
 
4360
4966
  function calculateUpdatedCargoCost(currentPaid, currentOwned, purchaseCost, purchaseQuantity) {
@@ -5064,7 +5670,7 @@ class TradesManager extends BaseManager {
5064
5670
  this.priceCacheEpoch = undefined;
5065
5671
  }
5066
5672
  async findDeals(ship, originLocation, options = {}) {
5067
- const origin = originLocation || ship.currentLocation;
5673
+ const origin = originLocation || Coordinates.from(ship.coordinates);
5068
5674
  const callbacks = await this.createCallbacks();
5069
5675
  const deals = await findDealsForShip(ship, origin, callbacks.getNearbyLocations, callbacks.getMarketPrices, options);
5070
5676
  return deals;
@@ -5074,7 +5680,7 @@ class TradesManager extends BaseManager {
5074
5680
  return deals[0];
5075
5681
  }
5076
5682
  async getCollectOptions(ship, arrivedAt, options = {}) {
5077
- const location = arrivedAt || ship.currentLocation;
5683
+ const location = arrivedAt || Coordinates.from(ship.coordinates);
5078
5684
  const callbacks = await this.createCallbacks();
5079
5685
  return analyzeCollectOptions(ship, location, callbacks, options);
5080
5686
  }
@@ -5131,6 +5737,20 @@ class ActionsManager extends BaseManager {
5131
5737
  recharge,
5132
5738
  });
5133
5739
  }
5740
+ grouptravel(entities, destination, recharge = true) {
5741
+ const entityRefs = entities.map((e) => Types.entity_ref.from({
5742
+ entity_type: e.entityType,
5743
+ entity_id: UInt64.from(e.entityId),
5744
+ }));
5745
+ const x = Int64.from(destination.x);
5746
+ const y = Int64.from(destination.y);
5747
+ return this.server.action('grouptravel', {
5748
+ entities: entityRefs,
5749
+ x,
5750
+ y,
5751
+ recharge,
5752
+ });
5753
+ }
5134
5754
  resolve(entityId, entityType = EntityType.SHIP) {
5135
5755
  return this.server.action('resolve', {
5136
5756
  entity_type: entityType,
@@ -5150,32 +5770,30 @@ class ActionsManager extends BaseManager {
5150
5770
  id: UInt64.from(shipId),
5151
5771
  });
5152
5772
  }
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
- }));
5773
+ transfer(sourceType, sourceId, destType, destId, goodId, quantity) {
5159
5774
  return this.server.action('transfer', {
5160
5775
  source_type: sourceType,
5161
5776
  source_id: UInt64.from(sourceId),
5162
5777
  dest_type: destType,
5163
5778
  dest_id: UInt64.from(destId),
5164
- cargo: cargoItems,
5779
+ good_id: UInt16.from(goodId),
5780
+ quantity: UInt32.from(quantity),
5165
5781
  });
5166
5782
  }
5167
- buyGoods(shipId, goodId, quantity) {
5783
+ buyGoods(entityId, goodId, quantity, entityType = EntityType.SHIP) {
5168
5784
  return this.server.action('buygoods', {
5169
- ship_id: UInt64.from(shipId),
5170
- good_id: UInt64.from(goodId),
5171
- quantity: UInt64.from(quantity),
5785
+ entity_type: entityType,
5786
+ id: UInt64.from(entityId),
5787
+ good_id: UInt16.from(goodId),
5788
+ quantity: UInt32.from(quantity),
5172
5789
  });
5173
5790
  }
5174
- sellGoods(shipId, goodId, quantity) {
5791
+ sellGoods(entityId, goodId, quantity, entityType = EntityType.SHIP) {
5175
5792
  return this.server.action('sellgoods', {
5176
- ship_id: UInt64.from(shipId),
5177
- good_id: UInt64.from(goodId),
5178
- quantity: UInt64.from(quantity),
5793
+ entity_type: entityType,
5794
+ id: UInt64.from(entityId),
5795
+ good_id: UInt16.from(goodId),
5796
+ quantity: UInt32.from(quantity),
5179
5797
  });
5180
5798
  }
5181
5799
  buyShip(account, name) {
@@ -5191,6 +5809,13 @@ class ActionsManager extends BaseManager {
5191
5809
  name,
5192
5810
  });
5193
5811
  }
5812
+ buyContainer(account, shipId, name) {
5813
+ return this.server.action('buycontainer', {
5814
+ account: Name.from(account),
5815
+ ship_id: UInt64.from(shipId),
5816
+ name,
5817
+ });
5818
+ }
5194
5819
  takeLoan(account, amount) {
5195
5820
  return this.server.action('takeloan', {
5196
5821
  account: Name.from(account),
@@ -5214,6 +5839,11 @@ class ActionsManager extends BaseManager {
5214
5839
  account: Name.from(account),
5215
5840
  });
5216
5841
  }
5842
+ extract(shipId) {
5843
+ return this.server.action('extract', {
5844
+ ship_id: UInt64.from(shipId),
5845
+ });
5846
+ }
5217
5847
  joinGame(account, companyName) {
5218
5848
  return [this.foundCompany(account, companyName), this.join(account)];
5219
5849
  }
@@ -5231,11 +5861,7 @@ class ActionsManager extends BaseManager {
5231
5861
  const shipId = ship instanceof Ship ? ship.id : UInt64.from(ship);
5232
5862
  return shipCargo
5233
5863
  .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
- }));
5864
+ .map((c) => this.sellGoods(shipId, c.good_id, c.quantity, EntityType.SHIP));
5239
5865
  }
5240
5866
  }
5241
5867
 
@@ -5382,178 +6008,118 @@ class Shipload {
5382
6008
  }
5383
6009
  }
5384
6010
 
5385
- function totalCargoMass(cargo) {
5386
- return cargo.reduce((sum, c) => {
5387
- return sum.adding(c.totalMass);
5388
- }, UInt64.from(0));
6011
+ function makeShip(state) {
6012
+ const entityInfo = Types.entity_info.from({
6013
+ type: Name.from('ship'),
6014
+ id: UInt64.from(state.id),
6015
+ owner: Name.from(state.owner),
6016
+ entity_name: state.name,
6017
+ coordinates: Types.coordinates.from(state.coordinates),
6018
+ hullmass: UInt32.from(state.hullmass),
6019
+ capacity: UInt32.from(state.capacity),
6020
+ energy: UInt16.from(state.energy),
6021
+ cargomass: UInt32.from(0),
6022
+ cargo: state.cargo || [],
6023
+ is_idle: !state.schedule,
6024
+ current_task_elapsed: UInt32.from(0),
6025
+ current_task_remaining: UInt32.from(0),
6026
+ pending_tasks: [],
6027
+ engines: state.engines,
6028
+ generator: state.generator,
6029
+ loaders: state.loaders,
6030
+ schedule: state.schedule,
6031
+ });
6032
+ return new Ship(entityInfo);
5389
6033
  }
5390
- function cargoValue(cargo) {
5391
- return cargo.reduce((sum, c) => {
5392
- return sum.adding(c.totalCost);
5393
- }, UInt64.from(0));
6034
+ function makeWarehouse(state) {
6035
+ const entityInfo = Types.entity_info.from({
6036
+ type: Name.from('warehouse'),
6037
+ id: UInt64.from(state.id),
6038
+ owner: Name.from(state.owner),
6039
+ entity_name: state.name,
6040
+ coordinates: Types.coordinates.from(state.coordinates),
6041
+ capacity: UInt32.from(state.capacity),
6042
+ cargomass: UInt32.from(0),
6043
+ cargo: state.cargo || [],
6044
+ loaders: state.loaders,
6045
+ is_idle: !state.schedule,
6046
+ current_task_elapsed: UInt32.from(0),
6047
+ current_task_remaining: UInt32.from(0),
6048
+ pending_tasks: [],
6049
+ schedule: state.schedule,
6050
+ });
6051
+ return new Warehouse(entityInfo);
5394
6052
  }
5395
- function getCargoForGood(cargo, goodId) {
5396
- return cargo.find((c) => c.good_id.equals(goodId));
6053
+ function makeContainer(state) {
6054
+ const entityInfo = Types.entity_info.from({
6055
+ type: Name.from('container'),
6056
+ id: UInt64.from(state.id),
6057
+ owner: Name.from(state.owner),
6058
+ entity_name: state.name,
6059
+ coordinates: Types.coordinates.from(state.coordinates),
6060
+ hullmass: UInt32.from(state.hullmass),
6061
+ capacity: UInt32.from(state.capacity),
6062
+ cargomass: UInt32.from(state.cargomass || 0),
6063
+ cargo: [],
6064
+ is_idle: !state.schedule,
6065
+ current_task_elapsed: UInt32.from(0),
6066
+ current_task_remaining: UInt32.from(0),
6067
+ pending_tasks: [],
6068
+ schedule: state.schedule,
6069
+ });
6070
+ return new Container(entityInfo);
5397
6071
  }
5398
- function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
5399
- const additionalMass = goodMass.multiplying(quantity);
5400
- const totalMass = currentMass.adding(additionalMass);
5401
- return totalMass.lte(maxCapacity);
6072
+
6073
+ function canMove(e) {
6074
+ return 'engines' in e && 'generator' in e && 'energy' in e;
5402
6075
  }
5403
- function availableCapacity(currentMass, maxCapacity) {
5404
- if (currentMass.gte(maxCapacity)) {
5405
- return UInt64.from(0);
5406
- }
5407
- return maxCapacity.subtracting(currentMass);
6076
+ function hasEnergy(e) {
6077
+ return 'energy' in e;
5408
6078
  }
5409
- function isFull(currentMass, maxCapacity) {
5410
- return currentMass.gte(maxCapacity);
6079
+ function hasStorage(e) {
6080
+ return 'capacity' in e && 'cargo' in e;
5411
6081
  }
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
- };
6082
+ function hasLoaders(e) {
6083
+ return 'loaders' in e && e.loaders !== undefined;
5444
6084
  }
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));
5456
- }
6085
+ function hasTrade(e) {
6086
+ return 'trade' in e && e.trade !== undefined;
5457
6087
  }
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);
5481
- }
6088
+ function hasMass(e) {
6089
+ return 'hullmass' in e;
5482
6090
  }
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
- }
6091
+ function hasSchedule(e) {
6092
+ return 'schedule' in e;
5488
6093
  }
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
- }
6094
+ function hasExtractor(e) {
6095
+ return 'extractor' in e && e.extractor !== undefined;
5497
6096
  }
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);
5516
- break;
5517
- }
5518
- }
5519
- return projected;
6097
+
6098
+ function calcLoadDuration(entity, cargoMass) {
6099
+ const totalThrust = entity.loaders.thrust.toNumber() * entity.loaders.quantity.toNumber();
6100
+ if (totalThrust === 0)
6101
+ return UInt32.from(0);
6102
+ return UInt32.from(Math.ceil(Number(cargoMass) / totalThrust));
5520
6103
  }
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
- }
6104
+
6105
+ function calc_load_time_internal(loaders, shipZ, cargoMass) {
6106
+ if (cargoMass === 0 || loaders.quantity.toNumber() === 0 || loaders.thrust.toNumber() === 0) {
6107
+ return 0;
5554
6108
  }
5555
- return projected;
6109
+ const totalMass = cargoMass + loaders.mass.toNumber();
6110
+ const acceleration = (loaders.thrust.toNumber() / totalMass) * PRECISION;
6111
+ const flightTime = Math.floor(2 * Math.sqrt(shipZ / acceleration));
6112
+ return Math.floor(flightTime / loaders.quantity.toNumber());
6113
+ }
6114
+ function calc_extraction_duration(extractor, loaders, shipZ, batchMass) {
6115
+ const extractionTime = Math.floor(batchMass / extractor.rate.toNumber());
6116
+ const loadingTime = calc_load_time_internal(loaders, shipZ, batchMass);
6117
+ return UInt32.from(Math.max(extractionTime, loadingTime));
6118
+ }
6119
+ function calc_extraction_energy(extractor, duration) {
6120
+ const energy = Math.floor((duration * extractor.drain.toNumber()) / PRECISION);
6121
+ return UInt16.from(energy);
5556
6122
  }
5557
6123
 
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 };
6124
+ export { ActionsManager, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, Container, 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_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_GOOD_QUANTITY, INSUFFICIENT_GOOD_SUPPLY, INVALID_AMOUNT, InventoryAccessor, Location, LocationType, 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, 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, deriveLocation, deriveLocationEpoch, deriveLocationMixture, deriveLocationStatic, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, estimateDealTravelTime, estimateTravelTime, findBestDeal, findBestGoodToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDestinationLocation, getEpochInfo, getFlightOrigin, getGood, getGoods, getLocationType, getPositionAt, getRarity, getSystemName, goodIds, 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, lerp, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, toLocation };
5559
6125
  //# sourceMappingURL=shipload.m.js.map