@shipload/sdk 1.0.0-next.7 → 1.0.0-next.71

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 (203) hide show
  1. package/lib/scan.d.ts +52 -0
  2. package/lib/scan.js +162 -0
  3. package/lib/scan.js.map +1 -0
  4. package/lib/scan.m.js +152 -0
  5. package/lib/scan.m.js.map +1 -0
  6. package/lib/shipload.d.ts +5822 -1484
  7. package/lib/shipload.js +20838 -5419
  8. package/lib/shipload.js.map +1 -1
  9. package/lib/shipload.m.js +20674 -5669
  10. package/lib/shipload.m.js.map +1 -1
  11. package/lib/testing.d.ts +1691 -0
  12. package/lib/testing.js +7109 -0
  13. package/lib/testing.js.map +1 -0
  14. package/lib/testing.m.js +7103 -0
  15. package/lib/testing.m.js.map +1 -0
  16. package/package.json +20 -2
  17. package/src/capabilities/craftable.test.ts +82 -0
  18. package/src/capabilities/craftable.ts +82 -0
  19. package/src/capabilities/crafting.test.ts +80 -0
  20. package/src/capabilities/crafting.ts +50 -8
  21. package/src/capabilities/gathering.test.ts +29 -0
  22. package/src/capabilities/gathering.ts +38 -20
  23. package/src/capabilities/hauling.ts +0 -5
  24. package/src/capabilities/index.ts +0 -1
  25. package/src/capabilities/modules.ts +27 -30
  26. package/src/capabilities/movement.ts +1 -1
  27. package/src/capabilities/storage.test.ts +26 -0
  28. package/src/capabilities/storage.ts +22 -7
  29. package/src/contracts/fund.ts +306 -0
  30. package/src/contracts/platform.ts +312 -3
  31. package/src/contracts/server.ts +2793 -478
  32. package/src/contracts/token.ts +170 -0
  33. package/src/contracts.ts +2 -0
  34. package/src/coordinates/address.ts +88 -0
  35. package/src/coordinates/constants.test.ts +15 -0
  36. package/src/coordinates/constants.ts +23 -0
  37. package/src/coordinates/index.ts +15 -0
  38. package/src/coordinates/memo.test.ts +47 -0
  39. package/src/coordinates/memo.ts +20 -0
  40. package/src/coordinates/permutation.ts +77 -0
  41. package/src/coordinates/regions.ts +48 -0
  42. package/src/coordinates/sectors.ts +115 -0
  43. package/src/data/capabilities.ts +49 -18
  44. package/src/data/capability-formulas.ts +26 -14
  45. package/src/data/catalog.test.ts +19 -0
  46. package/src/data/catalog.ts +13 -3
  47. package/src/data/charters.json +396 -0
  48. package/src/data/citizenry-adjectives.json +42 -0
  49. package/src/data/citizenry-nouns.json +50 -0
  50. package/src/data/colors.ts +14 -32
  51. package/src/data/entities.json +421 -15
  52. package/src/data/item-ids.ts +53 -13
  53. package/src/data/items.json +330 -77
  54. package/src/data/kind-registry.json +212 -0
  55. package/src/data/kind-registry.ts +192 -0
  56. package/src/data/metadata.ts +312 -51
  57. package/src/data/recipes-runtime.ts +6 -23
  58. package/src/data/recipes.json +2173 -173
  59. package/src/data/tiers.ts +9 -6
  60. package/src/derivation/build-methods.test.ts +71 -0
  61. package/src/derivation/build-methods.ts +50 -0
  62. package/src/derivation/capabilities.test.ts +348 -0
  63. package/src/derivation/capabilities.ts +707 -0
  64. package/src/derivation/capability-mappings.ts +60 -16
  65. package/src/derivation/crafting.test.ts +17 -0
  66. package/src/derivation/crafting.ts +57 -34
  67. package/src/derivation/index.ts +27 -2
  68. package/src/derivation/recipe-usage.test.ts +88 -0
  69. package/src/derivation/recipe-usage.ts +141 -0
  70. package/src/derivation/reserve-regen.ts +34 -0
  71. package/src/derivation/resources.ts +9 -1
  72. package/src/derivation/rollups.test.ts +55 -0
  73. package/src/derivation/rollups.ts +72 -0
  74. package/src/derivation/stars.test.ts +67 -0
  75. package/src/derivation/stars.ts +25 -0
  76. package/src/derivation/stat-scaling.ts +12 -0
  77. package/src/derivation/stats.ts +6 -6
  78. package/src/derivation/strata.ts +5 -3
  79. package/src/derivation/stratum.ts +26 -22
  80. package/src/derivation/tiers.ts +40 -7
  81. package/src/derivation/upgrades.ts +14 -0
  82. package/src/derivation/wormhole.ts +154 -0
  83. package/src/entities/entity.ts +102 -0
  84. package/src/entities/gamestate.ts +3 -28
  85. package/src/entities/makers.ts +144 -136
  86. package/src/entities/slot-multiplier.ts +43 -0
  87. package/src/entity/hydrate.test.ts +156 -0
  88. package/src/entity/hydrate.ts +86 -0
  89. package/src/errors.ts +21 -16
  90. package/src/format.ts +42 -9
  91. package/src/index-module.ts +425 -32
  92. package/src/influence/ballot.test.ts +103 -0
  93. package/src/influence/ballot.ts +98 -0
  94. package/src/influence/categories.ts +32 -0
  95. package/src/influence/charter-metadata.test.ts +136 -0
  96. package/src/influence/charter-metadata.ts +236 -0
  97. package/src/influence/charters.test.ts +112 -0
  98. package/src/influence/charters.ts +150 -0
  99. package/src/influence/citizenry.ts +38 -0
  100. package/src/influence/civic-shuttle.test.ts +202 -0
  101. package/src/influence/civic-shuttle.ts +142 -0
  102. package/src/influence/civic.test.ts +287 -0
  103. package/src/influence/civic.ts +269 -0
  104. package/src/influence/constants.ts +84 -0
  105. package/src/influence/decay.ts +20 -0
  106. package/src/influence/decomp.ts +95 -0
  107. package/src/influence/demand.ts +106 -0
  108. package/src/influence/duration.ts +101 -0
  109. package/src/influence/index.ts +118 -0
  110. package/src/influence/influence.test.ts +450 -0
  111. package/src/influence/quality.ts +25 -0
  112. package/src/influence/valuation.ts +154 -0
  113. package/src/managers/actions.ts +950 -93
  114. package/src/managers/balances.test.ts +161 -0
  115. package/src/managers/balances.ts +93 -0
  116. package/src/managers/base.ts +10 -2
  117. package/src/managers/cluster.test.ts +39 -0
  118. package/src/managers/cluster.ts +53 -0
  119. package/src/managers/construction-types.ts +80 -0
  120. package/src/managers/construction.ts +453 -0
  121. package/src/managers/context.ts +58 -1
  122. package/src/managers/coordinates.ts +14 -0
  123. package/src/managers/entities.ts +35 -63
  124. package/src/managers/epochs.ts +72 -1
  125. package/src/managers/index.ts +38 -1
  126. package/src/managers/influence.test.ts +56 -0
  127. package/src/managers/influence.ts +425 -0
  128. package/src/managers/jobs.test.ts +96 -0
  129. package/src/managers/jobs.ts +58 -0
  130. package/src/managers/locations.ts +25 -29
  131. package/src/managers/nft.test.ts +21 -0
  132. package/src/managers/nft.ts +110 -0
  133. package/src/managers/players.ts +25 -0
  134. package/src/managers/plot.ts +122 -0
  135. package/src/nft/atomicassets.abi.json +1342 -0
  136. package/src/nft/atomicassets.ts +237 -0
  137. package/src/nft/atomicdata.ts +130 -0
  138. package/src/nft/buildImmutableData.ts +388 -0
  139. package/src/nft/description.ts +222 -100
  140. package/src/nft/index.ts +3 -0
  141. package/src/planner/index.ts +296 -0
  142. package/src/planner/planner.test.ts +459 -0
  143. package/src/receipts.ts +22 -0
  144. package/src/resolution/describe-module.ts +43 -25
  145. package/src/resolution/display-name.ts +39 -11
  146. package/src/resolution/resolve-item.test.ts +48 -0
  147. package/src/resolution/resolve-item.ts +112 -58
  148. package/src/scan/index.ts +244 -0
  149. package/src/scan/scan-wasm.base64.ts +2 -0
  150. package/src/scheduling/accessor.ts +65 -23
  151. package/src/scheduling/availability.test.ts +320 -0
  152. package/src/scheduling/availability.ts +251 -0
  153. package/src/scheduling/cancel.test.ts +550 -0
  154. package/src/scheduling/cancel.ts +254 -0
  155. package/src/scheduling/cluster-stock.test.ts +31 -0
  156. package/src/scheduling/cluster-stock.ts +15 -0
  157. package/src/scheduling/energy.ts +47 -0
  158. package/src/scheduling/epoch.ts +1 -0
  159. package/src/scheduling/idle-resolve.ts +45 -0
  160. package/src/scheduling/jobs.test.ts +448 -0
  161. package/src/scheduling/jobs.ts +343 -0
  162. package/src/scheduling/lane-core.ts +128 -0
  163. package/src/scheduling/lanes.test.ts +250 -0
  164. package/src/scheduling/lanes.ts +279 -0
  165. package/src/scheduling/projection.ts +265 -149
  166. package/src/scheduling/schedule.test.ts +163 -0
  167. package/src/scheduling/schedule.ts +282 -116
  168. package/src/scheduling/task-cargo.test.ts +110 -0
  169. package/src/scheduling/task-cargo.ts +62 -0
  170. package/src/scheduling/task-effects.test.ts +35 -0
  171. package/src/scheduling/task-effects.ts +34 -0
  172. package/src/scheduling/unwrap.test.ts +86 -0
  173. package/src/scheduling/unwrap.ts +190 -0
  174. package/src/shipload.ts +63 -4
  175. package/src/subscriptions/manager.cluster.test.ts +51 -0
  176. package/src/subscriptions/manager.ts +245 -172
  177. package/src/subscriptions/mappers.ts +5 -8
  178. package/src/subscriptions/types.ts +28 -3
  179. package/src/testing/catalog-hash.ts +19 -0
  180. package/src/testing/index.ts +2 -0
  181. package/src/testing/projection-parity.ts +167 -0
  182. package/src/travel/reach.test.ts +86 -0
  183. package/src/travel/reach.ts +34 -0
  184. package/src/travel/route-build.test.ts +63 -0
  185. package/src/travel/route-build.ts +60 -0
  186. package/src/travel/route-planner.ts +288 -0
  187. package/src/travel/route-simulator.ts +170 -0
  188. package/src/travel/travel.ts +190 -123
  189. package/src/types/capabilities.ts +37 -8
  190. package/src/types/entity.ts +3 -3
  191. package/src/types/index.ts +0 -1
  192. package/src/types.ts +81 -23
  193. package/src/utils/cargo.test.ts +14 -0
  194. package/src/utils/cargo.ts +2 -0
  195. package/src/utils/display-name.ts +70 -0
  196. package/src/utils/hash.ts +22 -2
  197. package/src/utils/system.ts +24 -5
  198. package/src/capabilities/loading.ts +0 -8
  199. package/src/entities/container.ts +0 -123
  200. package/src/entities/ship-deploy.ts +0 -295
  201. package/src/entities/ship.ts +0 -221
  202. package/src/entities/warehouse.ts +0 -127
  203. package/src/types/entity-traits.ts +0 -69
@@ -0,0 +1,212 @@
1
+ {
2
+ "kinds": [
3
+ {
4
+ "kind": "ship",
5
+ "classification": "OrbitalVessel",
6
+ "capabilityFlags": 19,
7
+ "zCoord": 800,
8
+ "defaultLabel": "Ship"
9
+ },
10
+ {
11
+ "kind": "warehouse",
12
+ "classification": "OrbitalStructure",
13
+ "capabilityFlags": 20,
14
+ "zCoord": 0,
15
+ "defaultLabel": "Warehouse"
16
+ },
17
+ {
18
+ "kind": "extractor",
19
+ "classification": "OrbitalStructure",
20
+ "capabilityFlags": 20,
21
+ "zCoord": 0,
22
+ "defaultLabel": "Mining Rig"
23
+ },
24
+ {
25
+ "kind": "factory",
26
+ "classification": "OrbitalStructure",
27
+ "capabilityFlags": 20,
28
+ "zCoord": 0,
29
+ "defaultLabel": "Factory"
30
+ },
31
+ {
32
+ "kind": "mdriver",
33
+ "classification": "OrbitalStructure",
34
+ "capabilityFlags": 20,
35
+ "zCoord": 0,
36
+ "defaultLabel": "Mass Driver"
37
+ },
38
+ {
39
+ "kind": "mcatcher",
40
+ "classification": "OrbitalStructure",
41
+ "capabilityFlags": 28,
42
+ "zCoord": 0,
43
+ "defaultLabel": "Mass Catcher"
44
+ },
45
+ {
46
+ "kind": "container",
47
+ "classification": "OrbitalVessel",
48
+ "capabilityFlags": 3,
49
+ "zCoord": 300,
50
+ "defaultLabel": "Container"
51
+ },
52
+ {
53
+ "kind": "nexus",
54
+ "classification": "OrbitalStructure",
55
+ "capabilityFlags": 0,
56
+ "zCoord": 0,
57
+ "defaultLabel": "Nexus"
58
+ },
59
+ {
60
+ "kind": "plot",
61
+ "classification": "Plot",
62
+ "capabilityFlags": 0,
63
+ "zCoord": 0,
64
+ "defaultLabel": "Plot"
65
+ },
66
+ {
67
+ "kind": "hub",
68
+ "classification": "OrbitalStructure",
69
+ "capabilityFlags": 4,
70
+ "zCoord": 0,
71
+ "defaultLabel": "Station Hub"
72
+ },
73
+ {
74
+ "kind": "workshop",
75
+ "classification": "PlanetaryStructure",
76
+ "capabilityFlags": 0,
77
+ "zCoord": 0,
78
+ "defaultLabel": "Workshop"
79
+ },
80
+ {
81
+ "kind": "builddock",
82
+ "classification": "OrbitalStructure",
83
+ "capabilityFlags": 0,
84
+ "zCoord": 0,
85
+ "defaultLabel": "Construction Dock"
86
+ },
87
+ {
88
+ "kind": "depot",
89
+ "classification": "PlanetaryStructure",
90
+ "capabilityFlags": 32,
91
+ "zCoord": 0,
92
+ "defaultLabel": "Depot"
93
+ }
94
+ ],
95
+ "templates": [
96
+ {
97
+ "itemId": 10201,
98
+ "kind": "ship",
99
+ "displayLabel": "Ship"
100
+ },
101
+ {
102
+ "itemId": 10210,
103
+ "kind": "ship",
104
+ "displayLabel": "Roustabout"
105
+ },
106
+ {
107
+ "itemId": 10211,
108
+ "kind": "ship",
109
+ "displayLabel": "Prospector"
110
+ },
111
+ {
112
+ "itemId": 10212,
113
+ "kind": "ship",
114
+ "displayLabel": "Tender"
115
+ },
116
+ {
117
+ "itemId": 10213,
118
+ "kind": "ship",
119
+ "displayLabel": "Wright"
120
+ },
121
+ {
122
+ "itemId": 10214,
123
+ "kind": "ship",
124
+ "displayLabel": "Tug"
125
+ },
126
+ {
127
+ "itemId": 10215,
128
+ "kind": "ship",
129
+ "displayLabel": "Porter"
130
+ },
131
+ {
132
+ "itemId": 10218,
133
+ "kind": "ship",
134
+ "displayLabel": "Smith"
135
+ },
136
+ {
137
+ "itemId": 10202,
138
+ "kind": "warehouse",
139
+ "displayLabel": ""
140
+ },
141
+ {
142
+ "itemId": 10203,
143
+ "kind": "extractor",
144
+ "displayLabel": ""
145
+ },
146
+ {
147
+ "itemId": 10204,
148
+ "kind": "factory",
149
+ "displayLabel": ""
150
+ },
151
+ {
152
+ "itemId": 10205,
153
+ "kind": "mdriver",
154
+ "displayLabel": ""
155
+ },
156
+ {
157
+ "itemId": 10206,
158
+ "kind": "mcatcher",
159
+ "displayLabel": ""
160
+ },
161
+ {
162
+ "itemId": 10200,
163
+ "kind": "container",
164
+ "displayLabel": ""
165
+ },
166
+ {
167
+ "itemId": 11200,
168
+ "kind": "container",
169
+ "displayLabel": ""
170
+ },
171
+ {
172
+ "itemId": 10207,
173
+ "kind": "hub",
174
+ "displayLabel": ""
175
+ },
176
+ {
177
+ "itemId": 10208,
178
+ "kind": "workshop",
179
+ "displayLabel": ""
180
+ },
181
+ {
182
+ "itemId": 10209,
183
+ "kind": "builddock",
184
+ "displayLabel": ""
185
+ },
186
+ {
187
+ "itemId": 10216,
188
+ "kind": "nexus",
189
+ "displayLabel": ""
190
+ },
191
+ {
192
+ "itemId": 11212,
193
+ "kind": "ship",
194
+ "displayLabel": "Prospector"
195
+ },
196
+ {
197
+ "itemId": 11213,
198
+ "kind": "ship",
199
+ "displayLabel": "Prospector"
200
+ },
201
+ {
202
+ "itemId": 11214,
203
+ "kind": "ship",
204
+ "displayLabel": "Dredger"
205
+ },
206
+ {
207
+ "itemId": 10219,
208
+ "kind": "depot",
209
+ "displayLabel": ""
210
+ }
211
+ ]
212
+ }
@@ -0,0 +1,192 @@
1
+ import {Name, type NameType} from '@wharfkit/antelope'
2
+ import kindRegistryJson from './kind-registry.json'
3
+
4
+ export const CAP_WRAP = 0x01
5
+ export const CAP_UNDEPLOY = 0x02
6
+ export const CAP_DEMOLISH = 0x04
7
+ export const CAP_CATCH = 0x08
8
+ export const CAP_MODULES = 0x10
9
+ export const CAP_STORE_CARGO = 0x20
10
+
11
+ export enum EntityClass {
12
+ OrbitalVessel = 0,
13
+ PlanetaryStructure = 1,
14
+ Plot = 2,
15
+ OrbitalStructure = 3,
16
+ }
17
+
18
+ const CLASSIFICATION_BY_NAME: Record<string, EntityClass> = {
19
+ OrbitalVessel: EntityClass.OrbitalVessel,
20
+ PlanetaryStructure: EntityClass.PlanetaryStructure,
21
+ Plot: EntityClass.Plot,
22
+ OrbitalStructure: EntityClass.OrbitalStructure,
23
+ }
24
+
25
+ export type EntityTypeName =
26
+ | 'ship'
27
+ | 'warehouse'
28
+ | 'extractor'
29
+ | 'factory'
30
+ | 'builddock'
31
+ | 'workshop'
32
+ | 'container'
33
+ | 'nexus'
34
+ | 'plot'
35
+ | 'mdriver'
36
+ | 'mcatcher'
37
+ | 'hub'
38
+ | 'depot'
39
+
40
+ export interface KindMeta {
41
+ kind: Name
42
+ classification: EntityClass
43
+ capabilityFlags: number
44
+ zCoord: number
45
+ defaultLabel: string
46
+ }
47
+
48
+ export interface TemplateMeta {
49
+ itemId: number
50
+ kind: Name
51
+ displayLabel: string
52
+ }
53
+
54
+ interface RawKindEntry {
55
+ kind: string
56
+ classification: string
57
+ capabilityFlags: number
58
+ zCoord: number
59
+ defaultLabel: string
60
+ }
61
+
62
+ interface RawTemplateEntry {
63
+ itemId: number
64
+ kind: string
65
+ displayLabel: string
66
+ }
67
+
68
+ const KIND_META: Map<string, KindMeta> = (() => {
69
+ const m = new Map<string, KindMeta>()
70
+ for (const r of kindRegistryJson.kinds as RawKindEntry[]) {
71
+ const cls = CLASSIFICATION_BY_NAME[r.classification]
72
+ if (cls === undefined) {
73
+ throw new Error(
74
+ `kind-registry: unknown classification "${r.classification}" for kind ${r.kind}`
75
+ )
76
+ }
77
+ m.set(r.kind, {
78
+ kind: Name.from(r.kind),
79
+ classification: cls,
80
+ capabilityFlags: r.capabilityFlags,
81
+ zCoord: r.zCoord,
82
+ defaultLabel: r.defaultLabel,
83
+ })
84
+ }
85
+ return m
86
+ })()
87
+
88
+ export const ALL_ENTITY_TYPES: readonly EntityTypeName[] = Object.freeze([
89
+ ...KIND_META.keys(),
90
+ ] as EntityTypeName[])
91
+
92
+ const TEMPLATE_BY_ITEM_ID: Map<number, TemplateMeta> = (() => {
93
+ const m = new Map<number, TemplateMeta>()
94
+ for (const r of kindRegistryJson.templates as RawTemplateEntry[]) {
95
+ m.set(r.itemId, {
96
+ itemId: r.itemId,
97
+ kind: Name.from(r.kind),
98
+ displayLabel: r.displayLabel,
99
+ })
100
+ }
101
+ return m
102
+ })()
103
+
104
+ function nameKey(kind: NameType | EntityTypeName): string {
105
+ if (typeof kind === 'string') return kind
106
+ return Name.from(kind).toString()
107
+ }
108
+
109
+ export function getKindMeta(kind: NameType | EntityTypeName): KindMeta | undefined {
110
+ return KIND_META.get(nameKey(kind))
111
+ }
112
+
113
+ export function getTemplateMeta(itemId: number): TemplateMeta | undefined {
114
+ return TEMPLATE_BY_ITEM_ID.get(itemId)
115
+ }
116
+
117
+ export function getPackedEntityType(itemId: number): Name | null {
118
+ return TEMPLATE_BY_ITEM_ID.get(itemId)?.kind ?? null
119
+ }
120
+
121
+ export function kindCan(kind: NameType | EntityTypeName, cap: number): boolean {
122
+ const m = KIND_META.get(nameKey(kind))
123
+ return m !== undefined && (m.capabilityFlags & cap) !== 0
124
+ }
125
+
126
+ export function canCatch(kind: NameType | EntityTypeName): boolean {
127
+ return kindCan(kind, CAP_CATCH)
128
+ }
129
+
130
+ export function canStoreCargo(kind: NameType | EntityTypeName): boolean {
131
+ return kindCan(kind, CAP_STORE_CARGO)
132
+ }
133
+
134
+ export function getEntityClass(kind: NameType | EntityTypeName): EntityClass {
135
+ const m = KIND_META.get(nameKey(kind))
136
+ if (!m) throw new Error(`Entity type has no class: ${nameKey(kind)}`)
137
+ return m.classification
138
+ }
139
+
140
+ export const ENTITY_SHIP = Name.from('ship')
141
+ export const ENTITY_WAREHOUSE = Name.from('warehouse')
142
+ export const ENTITY_EXTRACTOR = Name.from('extractor')
143
+ export const ENTITY_FACTORY = Name.from('factory')
144
+ export const ENTITY_CONSTRUCTION_DOCK = Name.from('builddock')
145
+ export const ENTITY_WORKSHOP = Name.from('workshop')
146
+ export const ENTITY_CONTAINER = Name.from('container')
147
+ export const ENTITY_NEXUS = Name.from('nexus')
148
+ export const ENTITY_PLOT = Name.from('plot')
149
+ export const ENTITY_MASS_DRIVER = Name.from('mdriver')
150
+ export const ENTITY_MASS_CATCHER = Name.from('mcatcher')
151
+ export const ENTITY_HUB = Name.from('hub')
152
+ export const ENTITY_DEPOT = Name.from('depot')
153
+
154
+ export function isShip(entity: {type?: Name}): boolean {
155
+ return entity.type?.equals(ENTITY_SHIP) ?? false
156
+ }
157
+ export function isWarehouse(entity: {type?: Name}): boolean {
158
+ return entity.type?.equals(ENTITY_WAREHOUSE) ?? false
159
+ }
160
+ export function isExtractor(entity: {type?: Name}): boolean {
161
+ return entity.type?.equals(ENTITY_EXTRACTOR) ?? false
162
+ }
163
+ export function isFactory(entity: {type?: Name}): boolean {
164
+ return entity.type?.equals(ENTITY_FACTORY) ?? false
165
+ }
166
+ export function isConstructionDock(entity: {type?: Name}): boolean {
167
+ return entity.type?.equals(ENTITY_CONSTRUCTION_DOCK) ?? false
168
+ }
169
+ export function isWorkshop(entity: {type?: Name}): boolean {
170
+ return entity.type?.equals(ENTITY_WORKSHOP) ?? false
171
+ }
172
+ export function isContainer(entity: {type?: Name}): boolean {
173
+ return entity.type?.equals(ENTITY_CONTAINER) ?? false
174
+ }
175
+ export function isNexus(entity: {type?: Name}): boolean {
176
+ return entity.type?.equals(ENTITY_NEXUS) ?? false
177
+ }
178
+ export function isPlot(entity: {type?: Name}): boolean {
179
+ return entity.type?.equals(ENTITY_PLOT) ?? false
180
+ }
181
+ export function isMassDriver(entity: {type?: Name}): boolean {
182
+ return entity.type?.equals(ENTITY_MASS_DRIVER) ?? false
183
+ }
184
+ export function isMassCatcher(entity: {type?: Name}): boolean {
185
+ return entity.type?.equals(ENTITY_MASS_CATCHER) ?? false
186
+ }
187
+ export function isHub(entity: {type?: Name}): boolean {
188
+ return entity.type?.equals(ENTITY_HUB) ?? false
189
+ }
190
+ export function isDepot(entity: {type?: Name}): boolean {
191
+ return entity.type?.equals(ENTITY_DEPOT) ?? false
192
+ }