@shipload/sdk 1.0.0-next.34 → 1.0.0-next.36
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 +398 -51
- package/lib/shipload.js +1481 -400
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +1442 -401
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +101 -20
- package/lib/testing.js +201 -57
- package/lib/testing.js.map +1 -1
- package/lib/testing.m.js +201 -57
- package/lib/testing.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/crafting.ts +2 -3
- package/src/capabilities/gathering.test.ts +16 -0
- package/src/capabilities/gathering.ts +8 -11
- package/src/contracts/server.ts +147 -29
- package/src/coordinates/address.ts +88 -0
- package/src/coordinates/constants.test.ts +15 -0
- package/src/coordinates/constants.ts +23 -0
- package/src/coordinates/index.ts +15 -0
- package/src/coordinates/memo.test.ts +47 -0
- package/src/coordinates/memo.ts +20 -0
- package/src/coordinates/permutation.ts +77 -0
- package/src/coordinates/regions.ts +48 -0
- package/src/coordinates/sectors.ts +115 -0
- package/src/data/capability-formulas.ts +0 -1
- package/src/data/entities.json +4 -4
- package/src/data/items.json +5 -5
- package/src/data/recipes.json +39 -65
- package/src/derivation/capabilities.test.ts +133 -0
- package/src/derivation/capabilities.ts +66 -14
- package/src/derivation/rollups.test.ts +55 -0
- package/src/derivation/rollups.ts +56 -0
- package/src/derivation/wormhole.ts +115 -0
- package/src/entities/makers.ts +30 -3
- package/src/errors.ts +2 -0
- package/src/index-module.ts +38 -2
- package/src/managers/actions.ts +79 -5
- package/src/managers/construction.ts +6 -4
- package/src/managers/context.ts +9 -0
- package/src/managers/coordinates.ts +14 -0
- package/src/managers/plot.ts +2 -4
- package/src/nft/description.ts +25 -6
- package/src/planner/index.ts +127 -0
- package/src/planner/planner.test.ts +319 -0
- package/src/resolution/resolve-item.ts +4 -1
- package/src/scheduling/availability.ts +1 -1
- package/src/scheduling/cancel.test.ts +348 -0
- package/src/scheduling/cancel.ts +209 -0
- package/src/scheduling/lanes.test.ts +249 -0
- package/src/scheduling/lanes.ts +140 -2
- package/src/scheduling/projection.ts +75 -16
- package/src/scheduling/schedule.ts +3 -1
- package/src/shipload.ts +5 -0
- package/src/testing/projection-parity.ts +26 -2
- package/src/travel/travel.ts +116 -105
- package/src/types/capabilities.ts +23 -6
- package/src/types/entity.ts +3 -3
- package/src/types.ts +2 -1
- package/src/utils/system.ts +11 -0
package/src/types.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface ShipLike {
|
|
|
31
31
|
energy?: UInt16
|
|
32
32
|
engines?: ServerContract.Types.movement_stats
|
|
33
33
|
generator?: ServerContract.Types.energy_stats
|
|
34
|
-
|
|
34
|
+
loader_lanes?: ServerContract.Types.loader_lane[]
|
|
35
35
|
hauler?: ServerContract.Types.hauler_stats
|
|
36
36
|
capacity?: UInt32
|
|
37
37
|
}
|
|
@@ -51,6 +51,7 @@ export enum TaskType {
|
|
|
51
51
|
WARP = 6,
|
|
52
52
|
CRAFT = 7,
|
|
53
53
|
DEPLOY = 8,
|
|
54
|
+
TRANSIT = 9,
|
|
54
55
|
UNWRAP = 10,
|
|
55
56
|
UNDEPLOY = 11,
|
|
56
57
|
DEMOLISH = 13,
|
package/src/utils/system.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {hash512} from './hash'
|
|
|
3
3
|
import {Coordinates, type CoordinatesType, LocationType} from '../types'
|
|
4
4
|
import {ServerContract} from '../contracts'
|
|
5
5
|
import {deriveLocationSize} from '../derivation/location-size'
|
|
6
|
+
import {wormholeAt} from '../derivation/wormhole'
|
|
6
7
|
import syllables from '../data/syllables.json'
|
|
7
8
|
import nebulaAdjectives from '../data/nebula-adjectives.json'
|
|
8
9
|
import nebulaNouns from '../data/nebula-nouns.json'
|
|
@@ -110,6 +111,16 @@ export function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesTyp
|
|
|
110
111
|
return getLocationType(gameSeed, coordinates) !== LocationType.EMPTY
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
export function getLocationKind(
|
|
115
|
+
gameSeed: Checksum256Type,
|
|
116
|
+
x: number,
|
|
117
|
+
y: number
|
|
118
|
+
): 'wormhole' | 'system' | 'empty' {
|
|
119
|
+
if (wormholeAt(gameSeed, x, y)) return 'wormhole'
|
|
120
|
+
if (hasSystem(gameSeed, {x, y})) return 'system'
|
|
121
|
+
return 'empty'
|
|
122
|
+
}
|
|
123
|
+
|
|
113
124
|
export function deriveLocationStatic(
|
|
114
125
|
gameSeed: Checksum256Type,
|
|
115
126
|
coordinates: CoordinatesType
|