@shipload/sdk 1.0.0-next.3 → 1.0.0-next.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/shipload.d.ts +1849 -961
- package/lib/shipload.js +9089 -4854
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +8958 -4805
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +856 -0
- package/lib/testing.js +3739 -0
- package/lib/testing.js.map +1 -0
- package/lib/testing.m.js +3733 -0
- package/lib/testing.m.js.map +1 -0
- package/package.json +15 -2
- package/src/capabilities/craftable.ts +51 -0
- package/src/capabilities/crafting.test.ts +7 -0
- package/src/capabilities/crafting.ts +3 -3
- package/src/capabilities/gathering.ts +17 -7
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/modules.ts +6 -0
- package/src/capabilities/storage.ts +16 -1
- package/src/contracts/platform.ts +231 -3
- package/src/contracts/server.ts +816 -471
- package/src/data/capabilities.ts +14 -329
- package/src/data/capability-formulas.ts +76 -0
- package/src/data/catalog.ts +0 -5
- package/src/data/colors.ts +14 -47
- package/src/data/entities.json +46 -10
- package/src/data/item-ids.ts +15 -12
- package/src/data/items.json +302 -38
- package/src/data/kind-registry.json +85 -0
- package/src/data/kind-registry.ts +150 -0
- package/src/data/metadata.ts +100 -31
- package/src/data/recipes-runtime.ts +3 -23
- package/src/data/recipes.json +250 -113
- package/src/derivation/build-methods.ts +45 -0
- package/src/derivation/capabilities.ts +415 -0
- package/src/derivation/capability-mappings.ts +117 -0
- package/src/derivation/crafting.ts +23 -24
- package/src/derivation/index.ts +17 -2
- package/src/derivation/reserve-regen.ts +34 -0
- package/src/derivation/resources.ts +125 -38
- package/src/derivation/stars.test.ts +51 -0
- package/src/derivation/stars.ts +15 -0
- package/src/derivation/stats.ts +6 -6
- package/src/derivation/stratum.ts +15 -19
- package/src/derivation/tiers.ts +28 -7
- package/src/entities/entity.ts +98 -0
- package/src/entities/gamestate.ts +3 -28
- package/src/entities/makers.ts +91 -136
- package/src/entities/slot-multiplier.ts +39 -0
- package/src/errors.ts +10 -15
- package/src/format.ts +26 -4
- package/src/index-module.ts +189 -47
- package/src/managers/actions.ts +252 -83
- package/src/managers/base.ts +6 -2
- package/src/managers/construction-types.ts +79 -0
- package/src/managers/construction.ts +396 -0
- package/src/managers/context.ts +11 -1
- package/src/managers/entities.ts +18 -66
- package/src/managers/epochs.ts +40 -0
- package/src/managers/index.ts +17 -1
- package/src/managers/locations.ts +25 -29
- package/src/managers/nft.ts +28 -0
- package/src/managers/plot.ts +127 -0
- package/src/nft/atomicassets.abi.json +1342 -0
- package/src/nft/atomicassets.ts +237 -0
- package/src/nft/atomicdata.ts +130 -0
- package/src/nft/buildImmutableData.ts +321 -0
- package/src/nft/description.ts +37 -15
- package/src/nft/index.ts +3 -0
- package/src/resolution/describe-module.ts +5 -8
- package/src/resolution/display-name.ts +38 -10
- package/src/resolution/resolve-item.ts +22 -20
- package/src/scheduling/accessor.ts +68 -22
- package/src/scheduling/availability.ts +108 -0
- package/src/scheduling/energy.ts +48 -0
- package/src/scheduling/lane-core.ts +130 -0
- package/src/scheduling/lanes.ts +60 -0
- package/src/scheduling/projection.ts +121 -94
- package/src/scheduling/schedule.ts +237 -103
- package/src/scheduling/task-cargo.ts +46 -0
- package/src/shipload.ts +16 -1
- package/src/subscriptions/manager.ts +40 -6
- package/src/subscriptions/mappers.ts +3 -8
- package/src/subscriptions/types.ts +3 -2
- package/src/testing/catalog-hash.ts +19 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/projection-parity.ts +143 -0
- package/src/travel/travel.ts +90 -13
- package/src/types/capabilities.ts +1 -0
- package/src/types/index.ts +0 -1
- package/src/types.ts +19 -12
- package/src/utils/cargo.ts +27 -0
- package/src/utils/display-name.ts +70 -0
- package/src/utils/system.ts +25 -24
- package/src/capabilities/loading.ts +0 -8
- package/src/entities/container.ts +0 -108
- package/src/entities/ship-deploy.ts +0 -258
- package/src/entities/ship.ts +0 -204
- package/src/entities/warehouse.ts +0 -119
- package/src/types/entity-traits.ts +0 -69
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {Name} from '@wharfkit/antelope'
|
|
2
|
-
|
|
3
|
-
export const ENTITY_SHIP = Name.from('ship')
|
|
4
|
-
export const ENTITY_WAREHOUSE = Name.from('warehouse')
|
|
5
|
-
export const ENTITY_CONTAINER = Name.from('container')
|
|
6
|
-
|
|
7
|
-
export type EntityTypeName = 'ship' | 'warehouse' | 'container'
|
|
8
|
-
|
|
9
|
-
export interface EntityTraits {
|
|
10
|
-
typeName: Name
|
|
11
|
-
isMovable: boolean
|
|
12
|
-
hasEnergy: boolean
|
|
13
|
-
hasLoaders: boolean
|
|
14
|
-
notFoundError: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const shipTraits: EntityTraits = {
|
|
18
|
-
typeName: ENTITY_SHIP,
|
|
19
|
-
isMovable: true,
|
|
20
|
-
hasEnergy: true,
|
|
21
|
-
hasLoaders: true,
|
|
22
|
-
|
|
23
|
-
notFoundError: 'ship not found',
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const warehouseTraits: EntityTraits = {
|
|
27
|
-
typeName: ENTITY_WAREHOUSE,
|
|
28
|
-
isMovable: false,
|
|
29
|
-
hasEnergy: false,
|
|
30
|
-
hasLoaders: true,
|
|
31
|
-
|
|
32
|
-
notFoundError: 'warehouse not found',
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const containerTraits: EntityTraits = {
|
|
36
|
-
typeName: ENTITY_CONTAINER,
|
|
37
|
-
isMovable: true,
|
|
38
|
-
hasEnergy: false,
|
|
39
|
-
hasLoaders: false,
|
|
40
|
-
|
|
41
|
-
notFoundError: 'container not found',
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function getEntityTraits(entityType: Name | EntityTypeName): EntityTraits {
|
|
45
|
-
const typeName = typeof entityType === 'string' ? entityType : entityType.toString()
|
|
46
|
-
|
|
47
|
-
switch (typeName) {
|
|
48
|
-
case 'ship':
|
|
49
|
-
return shipTraits
|
|
50
|
-
case 'warehouse':
|
|
51
|
-
return warehouseTraits
|
|
52
|
-
case 'container':
|
|
53
|
-
return containerTraits
|
|
54
|
-
default:
|
|
55
|
-
throw new Error(`Unknown entity type: ${typeName}`)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function isShip(entity: {type?: Name}): boolean {
|
|
60
|
-
return entity.type?.equals(ENTITY_SHIP) ?? false
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function isWarehouse(entity: {type?: Name}): boolean {
|
|
64
|
-
return entity.type?.equals(ENTITY_WAREHOUSE) ?? false
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function isContainer(entity: {type?: Name}): boolean {
|
|
68
|
-
return entity.type?.equals(ENTITY_CONTAINER) ?? false
|
|
69
|
-
}
|