ultimatedarktower 4.0.0 → 4.1.0
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/CHANGELOG.md +26 -0
- package/README.md +105 -253
- package/dist/esm/index.mjs +947 -25
- package/dist/src/UltimateDarkTower.d.ts +7 -0
- package/dist/src/UltimateDarkTower.js +13 -1
- package/dist/src/UltimateDarkTower.js.map +1 -1
- package/dist/src/adapters/NoopBluetoothAdapter.d.ts +26 -0
- package/dist/src/adapters/NoopBluetoothAdapter.js +50 -0
- package/dist/src/adapters/NoopBluetoothAdapter.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +29 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/udtBleConnection.d.ts +13 -0
- package/dist/src/udtBleConnection.js +66 -19
- package/dist/src/udtBleConnection.js.map +1 -1
- package/dist/src/udtBluetoothAdapterFactory.d.ts +3 -1
- package/dist/src/udtBluetoothAdapterFactory.js +6 -0
- package/dist/src/udtBluetoothAdapterFactory.js.map +1 -1
- package/dist/src/udtBoardAdjacency.d.ts +25 -0
- package/dist/src/udtBoardAdjacency.js +397 -0
- package/dist/src/udtBoardAdjacency.js.map +1 -0
- package/dist/src/udtBoardAnchors.d.ts +34 -0
- package/dist/src/udtBoardAnchors.js +357 -0
- package/dist/src/udtBoardAnchors.js.map +1 -0
- package/dist/src/udtDisplayExports.d.ts +2 -0
- package/dist/src/udtDisplayExports.js +26 -0
- package/dist/src/udtDisplayExports.js.map +1 -0
- package/dist/src/udtFoes.d.ts +53 -0
- package/dist/src/udtFoes.js +47 -0
- package/dist/src/udtFoes.js.map +1 -0
- package/dist/src/udtHeroes.d.ts +30 -0
- package/dist/src/udtHeroes.js +38 -0
- package/dist/src/udtHeroes.js.map +1 -0
- package/dist/src/udtMonuments.d.ts +23 -0
- package/dist/src/udtMonuments.js +20 -0
- package/dist/src/udtMonuments.js.map +1 -0
- package/dist/src/udtTowerCommands.js +8 -0
- package/dist/src/udtTowerCommands.js.map +1 -1
- package/dist/src/udtTowerResponse.js +1 -2
- package/dist/src/udtTowerResponse.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,6 +6,8 @@ var BluetoothPlatform;
|
|
|
6
6
|
BluetoothPlatform["WEB"] = "web";
|
|
7
7
|
BluetoothPlatform["NODE"] = "node";
|
|
8
8
|
BluetoothPlatform["AUTO"] = "auto";
|
|
9
|
+
/** Software-only — no Bluetooth (e.g. headless rendering, iOS Safari). Returns a no-op adapter. */
|
|
10
|
+
BluetoothPlatform["NONE"] = "none";
|
|
9
11
|
})(BluetoothPlatform || (exports.BluetoothPlatform = BluetoothPlatform = {}));
|
|
10
12
|
class BluetoothAdapterFactory {
|
|
11
13
|
/**
|
|
@@ -26,6 +28,10 @@ class BluetoothAdapterFactory {
|
|
|
26
28
|
const { NodeBluetoothAdapter } = require('./adapters/NodeBluetoothAdapter');
|
|
27
29
|
return new NodeBluetoothAdapter();
|
|
28
30
|
}
|
|
31
|
+
case BluetoothPlatform.NONE: {
|
|
32
|
+
const { NoopBluetoothAdapter } = require('./adapters/NoopBluetoothAdapter');
|
|
33
|
+
return new NoopBluetoothAdapter();
|
|
34
|
+
}
|
|
29
35
|
default:
|
|
30
36
|
throw new Error(`Unsupported Bluetooth platform: ${detectedPlatform}`);
|
|
31
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"udtBluetoothAdapterFactory.js","sourceRoot":"","sources":["../../src/udtBluetoothAdapterFactory.ts"],"names":[],"mappings":";;;AAEA,IAAY,
|
|
1
|
+
{"version":3,"file":"udtBluetoothAdapterFactory.js","sourceRoot":"","sources":["../../src/udtBluetoothAdapterFactory.ts"],"names":[],"mappings":";;;AAEA,IAAY,iBAMX;AAND,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,mGAAmG;IACnG,kCAAa,CAAA;AACjB,CAAC,EANW,iBAAiB,iCAAjB,iBAA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,EAAE,CAAC;YACpE,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;gBAC3B,OAAO,iBAAiB,CAAC,GAAG,CAAC;YACjC,CAAC;QACL,CAAC;QAED,gCAAgC;QAChC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC9E,OAAO,iBAAiB,CAAC,IAAI,CAAC;QAClC,CAAC;QAED,MAAM,IAAI,KAAK,CACX,uCAAuC;YACvC,iEAAiE;YACjE,iEAAiE,CACpE,CAAC;IACN,CAAC;CACJ;AA7DD,0DA6DC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Undirected movement-adjacency graph for the 60 board locations, with derived
|
|
3
|
+
* BFS helpers. The graph reflects physical movement adjacency only — kingdoms
|
|
4
|
+
* separated by rivers may be disconnected (`stepDistance` = Infinity); bridges,
|
|
5
|
+
* flight, and teleport are *rules* a host layers on, not graph edges. These are
|
|
6
|
+
* utilities: the board itself enforces no movement rules.
|
|
7
|
+
*
|
|
8
|
+
* GENERATED from tools/location-marker/udtBoardData.json by gen-board-data.mjs.
|
|
9
|
+
* Do not hand-edit — re-author in the location-marker tool and regenerate.
|
|
10
|
+
*/
|
|
11
|
+
export type BoardAdjacency = Readonly<Record<string, readonly string[]>>;
|
|
12
|
+
/** Undirected, symmetric adjacency for all 60 board locations. */
|
|
13
|
+
export declare const BOARD_ADJACENCY: BoardAdjacency;
|
|
14
|
+
/** The locations directly adjacent to `loc` (empty if `loc` is unknown). */
|
|
15
|
+
export declare function neighborsOf(loc: string): readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Breadth-first step distance between two locations. 0 to itself; `Infinity` if
|
|
18
|
+
* they are disconnected or either name is unknown.
|
|
19
|
+
*/
|
|
20
|
+
export declare function stepDistance(a: string, b: string): number;
|
|
21
|
+
/**
|
|
22
|
+
* Breadth-first shortest path between two locations, inclusive of both endpoints.
|
|
23
|
+
* `[a]` to itself; `[]` if they are disconnected or either name is unknown.
|
|
24
|
+
*/
|
|
25
|
+
export declare function shortestPath(a: string, b: string): readonly string[];
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Undirected movement-adjacency graph for the 60 board locations, with derived
|
|
4
|
+
* BFS helpers. The graph reflects physical movement adjacency only — kingdoms
|
|
5
|
+
* separated by rivers may be disconnected (`stepDistance` = Infinity); bridges,
|
|
6
|
+
* flight, and teleport are *rules* a host layers on, not graph edges. These are
|
|
7
|
+
* utilities: the board itself enforces no movement rules.
|
|
8
|
+
*
|
|
9
|
+
* GENERATED from tools/location-marker/udtBoardData.json by gen-board-data.mjs.
|
|
10
|
+
* Do not hand-edit — re-author in the location-marker tool and regenerate.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.BOARD_ADJACENCY = void 0;
|
|
14
|
+
exports.neighborsOf = neighborsOf;
|
|
15
|
+
exports.stepDistance = stepDistance;
|
|
16
|
+
exports.shortestPath = shortestPath;
|
|
17
|
+
/** Undirected, symmetric adjacency for all 60 board locations. */
|
|
18
|
+
exports.BOARD_ADJACENCY = {
|
|
19
|
+
'Howling Desert': [
|
|
20
|
+
"Azkol's Bane",
|
|
21
|
+
'Idran Forest',
|
|
22
|
+
'Irontops',
|
|
23
|
+
'Lonelight Hills',
|
|
24
|
+
'Mountains of the Watchers',
|
|
25
|
+
'The Cloister',
|
|
26
|
+
'The Emerald Expanse',
|
|
27
|
+
],
|
|
28
|
+
'Mountains of the Watchers': [
|
|
29
|
+
'Howling Desert',
|
|
30
|
+
'Idran Forest',
|
|
31
|
+
'Lost Lands',
|
|
32
|
+
'Plains of Woldra',
|
|
33
|
+
'The Emerald Expanse',
|
|
34
|
+
],
|
|
35
|
+
'The Emerald Expanse': [
|
|
36
|
+
"Azkol's Bane",
|
|
37
|
+
'Bone Hills',
|
|
38
|
+
'Howling Desert',
|
|
39
|
+
'Lost Lands',
|
|
40
|
+
'Mountains of the Watchers',
|
|
41
|
+
],
|
|
42
|
+
"Azkol's Bane": [
|
|
43
|
+
'Archmont',
|
|
44
|
+
'Bone Hills',
|
|
45
|
+
'Howling Desert',
|
|
46
|
+
'The Cloister',
|
|
47
|
+
'The Emerald Expanse',
|
|
48
|
+
],
|
|
49
|
+
'The Cloister': [
|
|
50
|
+
'Archmont',
|
|
51
|
+
"Azkol's Bane",
|
|
52
|
+
'Howling Desert',
|
|
53
|
+
'Irontops',
|
|
54
|
+
'Sands of Madness',
|
|
55
|
+
'The Throne',
|
|
56
|
+
],
|
|
57
|
+
Irontops: ['Howling Desert', 'Lonelight Hills', 'The Cloister', 'The Grass Sea', 'The Throne'],
|
|
58
|
+
'Idran Forest': [
|
|
59
|
+
'Anza',
|
|
60
|
+
'Howling Desert',
|
|
61
|
+
'Lonelight Hills',
|
|
62
|
+
'Mountains of the Watchers',
|
|
63
|
+
'Plains of Woldra',
|
|
64
|
+
'Weeping Waters',
|
|
65
|
+
],
|
|
66
|
+
'Lonelight Hills': [
|
|
67
|
+
'Hissing Groves',
|
|
68
|
+
'Howling Desert',
|
|
69
|
+
'Idran Forest',
|
|
70
|
+
'Irontops',
|
|
71
|
+
'The Grass Sea',
|
|
72
|
+
'Weeping Waters',
|
|
73
|
+
],
|
|
74
|
+
'The Grass Sea': [
|
|
75
|
+
'Ash Hills',
|
|
76
|
+
'Hissing Groves',
|
|
77
|
+
'Irontops',
|
|
78
|
+
'Lonelight Hills',
|
|
79
|
+
'Tower Scar Desert',
|
|
80
|
+
],
|
|
81
|
+
'The Throne': [
|
|
82
|
+
'Big Sister',
|
|
83
|
+
'Forest of Shades',
|
|
84
|
+
'Irontops',
|
|
85
|
+
'Sands of Madness',
|
|
86
|
+
'The Cloister',
|
|
87
|
+
],
|
|
88
|
+
'Sands of Madness': [
|
|
89
|
+
'Archmont',
|
|
90
|
+
'Big Sister',
|
|
91
|
+
'Little Sister',
|
|
92
|
+
'Middle Sister',
|
|
93
|
+
'The Cloister',
|
|
94
|
+
'The Throne',
|
|
95
|
+
],
|
|
96
|
+
Archmont: [
|
|
97
|
+
"Azkol's Bane",
|
|
98
|
+
'Bone Hills',
|
|
99
|
+
'Little Sister',
|
|
100
|
+
'Sands of Madness',
|
|
101
|
+
'Southern Wastes',
|
|
102
|
+
'The Cloister',
|
|
103
|
+
],
|
|
104
|
+
'Bone Hills': ['Archmont', "Azkol's Bane", 'Southern Wastes', 'The Emerald Expanse'],
|
|
105
|
+
'Little Sister': [
|
|
106
|
+
'Archmont',
|
|
107
|
+
'Middle Sister',
|
|
108
|
+
'Sands of Madness',
|
|
109
|
+
'Southern Wastes',
|
|
110
|
+
"Ulamel's Hollow",
|
|
111
|
+
],
|
|
112
|
+
'Forest of Shades': [
|
|
113
|
+
'Big Sister',
|
|
114
|
+
'Bleak Wastes',
|
|
115
|
+
'Dragontooth Lake',
|
|
116
|
+
'Greater Tombstones',
|
|
117
|
+
'The Throne',
|
|
118
|
+
],
|
|
119
|
+
'Big Sister': [
|
|
120
|
+
'Forest of Shades',
|
|
121
|
+
'Greater Tombstones',
|
|
122
|
+
'Lesser Tombstones',
|
|
123
|
+
'Middle Sister',
|
|
124
|
+
'Sands of Madness',
|
|
125
|
+
'The Throne',
|
|
126
|
+
],
|
|
127
|
+
'Middle Sister': [
|
|
128
|
+
'Big Sister',
|
|
129
|
+
'Lesser Tombstones',
|
|
130
|
+
'Little Sister',
|
|
131
|
+
'Pine Barrens',
|
|
132
|
+
'Sands of Madness',
|
|
133
|
+
'Three Rivers',
|
|
134
|
+
"Ulamel's Hollow",
|
|
135
|
+
],
|
|
136
|
+
'Southern Wastes': ['Archmont', 'Bone Hills', 'Little Sister', "Ulamel's Hollow"],
|
|
137
|
+
"Ulamel's Hollow": ['Little Sister', 'Middle Sister', 'Pine Barrens', 'Southern Wastes'],
|
|
138
|
+
'Pine Barrens': ['Middle Sister', 'Three Rivers', "Ulamel's Hollow"],
|
|
139
|
+
'Plains of Woldra': ['Anza', 'Idran Forest', 'Lost Lands', 'Mountains of the Watchers'],
|
|
140
|
+
'Lost Lands': ['Mountains of the Watchers', 'Plains of Woldra', 'The Emerald Expanse'],
|
|
141
|
+
'Weeping Waters': [
|
|
142
|
+
'Anza',
|
|
143
|
+
'Hissing Groves',
|
|
144
|
+
'Idran Forest',
|
|
145
|
+
'Lonelight Hills',
|
|
146
|
+
'The Empty Glade',
|
|
147
|
+
'Yellowpike',
|
|
148
|
+
],
|
|
149
|
+
Anza: ['Idran Forest', 'Plains of Woldra', 'Weeping Waters', 'Yellowpike'],
|
|
150
|
+
'Hissing Groves': [
|
|
151
|
+
'Ash Hills',
|
|
152
|
+
'Cloudhold',
|
|
153
|
+
'Lonelight Hills',
|
|
154
|
+
'The Empty Glade',
|
|
155
|
+
'The Grass Sea',
|
|
156
|
+
'Weeping Waters',
|
|
157
|
+
],
|
|
158
|
+
'Ash Hills': [
|
|
159
|
+
'Broken Lands',
|
|
160
|
+
'Cloudhold',
|
|
161
|
+
'Hissing Groves',
|
|
162
|
+
'Muted Forest',
|
|
163
|
+
'The Grass Sea',
|
|
164
|
+
'Tower Scar Desert',
|
|
165
|
+
],
|
|
166
|
+
'The Empty Glade': [
|
|
167
|
+
'Arkartus',
|
|
168
|
+
'Cloudhold',
|
|
169
|
+
'Delmsmire',
|
|
170
|
+
'Hissing Groves',
|
|
171
|
+
'Weeping Waters',
|
|
172
|
+
'Yellowpike',
|
|
173
|
+
],
|
|
174
|
+
Yellowpike: ['Anza', 'Arkartus', 'The Empty Glade', 'Weeping Waters'],
|
|
175
|
+
Arkartus: ['Delmsmire', 'The Empty Glade', 'Yellowpike'],
|
|
176
|
+
Delmsmire: ['Arkartus', 'Cloudhold', 'Plains of Plovo', 'The Empty Glade'],
|
|
177
|
+
Cloudhold: [
|
|
178
|
+
'Ash Hills',
|
|
179
|
+
'Broken Lands',
|
|
180
|
+
'Delmsmire',
|
|
181
|
+
'Hissing Groves',
|
|
182
|
+
'Plains of Plovo',
|
|
183
|
+
'The Empty Glade',
|
|
184
|
+
],
|
|
185
|
+
'Plains of Plovo': ['Broken Lands', 'Cloudhold', 'Delmsmire', 'Lodestone Mountains'],
|
|
186
|
+
'Lodestone Mountains': [
|
|
187
|
+
'Broken Lands',
|
|
188
|
+
'Pearl of the North',
|
|
189
|
+
'Plains of Plovo',
|
|
190
|
+
'Radiant Mountains',
|
|
191
|
+
],
|
|
192
|
+
'Broken Lands': [
|
|
193
|
+
'Ash Hills',
|
|
194
|
+
'Cloudhold',
|
|
195
|
+
'Lodestone Mountains',
|
|
196
|
+
'Muted Forest',
|
|
197
|
+
'Plains of Plovo',
|
|
198
|
+
'Radiant Mountains',
|
|
199
|
+
],
|
|
200
|
+
'Muted Forest': [
|
|
201
|
+
'Ash Hills',
|
|
202
|
+
'Broken Lands',
|
|
203
|
+
'Green Bridge',
|
|
204
|
+
'Radiant Mountains',
|
|
205
|
+
'Tower Scar Desert',
|
|
206
|
+
'Upper Ice Fangs',
|
|
207
|
+
],
|
|
208
|
+
'Tower Scar Desert': [
|
|
209
|
+
'Ash Hills',
|
|
210
|
+
'Bleak Wastes',
|
|
211
|
+
'Muted Forest',
|
|
212
|
+
'The Grass Sea',
|
|
213
|
+
'Upper Ice Fangs',
|
|
214
|
+
],
|
|
215
|
+
'Radiant Mountains': [
|
|
216
|
+
'Broken Lands',
|
|
217
|
+
'Fivepint',
|
|
218
|
+
'Green Bridge',
|
|
219
|
+
'Lodestone Mountains',
|
|
220
|
+
'Muted Forest',
|
|
221
|
+
'Pearl of the North',
|
|
222
|
+
],
|
|
223
|
+
'Pearl of the North': ['Fivepint', 'Lodestone Mountains', 'Radiant Mountains'],
|
|
224
|
+
'Green Bridge': [
|
|
225
|
+
'Dayside',
|
|
226
|
+
'Fivepint',
|
|
227
|
+
'Lower Ice Fangs',
|
|
228
|
+
'Muted Forest',
|
|
229
|
+
'Radiant Mountains',
|
|
230
|
+
'Upper Ice Fangs',
|
|
231
|
+
],
|
|
232
|
+
Fivepint: ['Dayside', 'Green Bridge', 'Pearl of the North', 'Radiant Mountains'],
|
|
233
|
+
Dayside: ['Fivepint', 'Green Bridge', 'Lower Ice Fangs', 'The Tundra'],
|
|
234
|
+
'Upper Ice Fangs': [
|
|
235
|
+
'Bleak Wastes',
|
|
236
|
+
'Green Bridge',
|
|
237
|
+
'Lower Ice Fangs',
|
|
238
|
+
'Muted Forest',
|
|
239
|
+
'Peaks of the Djinn',
|
|
240
|
+
'Tower Scar Desert',
|
|
241
|
+
],
|
|
242
|
+
'Bleak Wastes': [
|
|
243
|
+
'Dragontooth Lake',
|
|
244
|
+
'Forest of Shades',
|
|
245
|
+
'Peaks of the Djinn',
|
|
246
|
+
'Tower Scar Desert',
|
|
247
|
+
'Upper Ice Fangs',
|
|
248
|
+
],
|
|
249
|
+
'Lower Ice Fangs': [
|
|
250
|
+
'Dayside',
|
|
251
|
+
'Green Bridge',
|
|
252
|
+
'Peaks of the Djinn',
|
|
253
|
+
'Rimeweald',
|
|
254
|
+
'The Tundra',
|
|
255
|
+
'Upper Ice Fangs',
|
|
256
|
+
],
|
|
257
|
+
'Peaks of the Djinn': [
|
|
258
|
+
'Bleak Wastes',
|
|
259
|
+
'Dragontooth Lake',
|
|
260
|
+
'Inner Kinghills',
|
|
261
|
+
'Lower Ice Fangs',
|
|
262
|
+
'Rimeweald',
|
|
263
|
+
'Upper Ice Fangs',
|
|
264
|
+
],
|
|
265
|
+
Rimeweald: [
|
|
266
|
+
"Egan's End",
|
|
267
|
+
'Inner Kinghills',
|
|
268
|
+
'Lower Ice Fangs',
|
|
269
|
+
'Outer Kinghills',
|
|
270
|
+
'Peaks of the Djinn',
|
|
271
|
+
'The Tundra',
|
|
272
|
+
],
|
|
273
|
+
"Egan's End": ['Outer Kinghills', 'Rimeweald', 'The Tundra'],
|
|
274
|
+
'The Tundra': ['Dayside', "Egan's End", 'Lower Ice Fangs', 'Rimeweald'],
|
|
275
|
+
'Outer Kinghills': ['Copper Grove', "Egan's End", 'Inner Kinghills', 'Rimeweald'],
|
|
276
|
+
'Inner Kinghills': [
|
|
277
|
+
'Copper Grove',
|
|
278
|
+
'Dragontooth Lake',
|
|
279
|
+
'Outer Kinghills',
|
|
280
|
+
'Peaks of the Djinn',
|
|
281
|
+
'Rimeweald',
|
|
282
|
+
'The Decaying Wilds',
|
|
283
|
+
],
|
|
284
|
+
'Copper Grove': ['Inner Kinghills', 'Jewel Hills', 'Outer Kinghills', 'The Decaying Wilds'],
|
|
285
|
+
'The Decaying Wilds': [
|
|
286
|
+
'Copper Grove',
|
|
287
|
+
'Dragontooth Lake',
|
|
288
|
+
'Greater Tombstones',
|
|
289
|
+
'Inner Kinghills',
|
|
290
|
+
'Jewel Hills',
|
|
291
|
+
"Utar's Barrows",
|
|
292
|
+
],
|
|
293
|
+
'Dragontooth Lake': [
|
|
294
|
+
'Bleak Wastes',
|
|
295
|
+
'Forest of Shades',
|
|
296
|
+
'Greater Tombstones',
|
|
297
|
+
'Inner Kinghills',
|
|
298
|
+
'Peaks of the Djinn',
|
|
299
|
+
'The Decaying Wilds',
|
|
300
|
+
],
|
|
301
|
+
'Greater Tombstones': [
|
|
302
|
+
'Big Sister',
|
|
303
|
+
'Dragontooth Lake',
|
|
304
|
+
'Forest of Shades',
|
|
305
|
+
'Lesser Tombstones',
|
|
306
|
+
'The Decaying Wilds',
|
|
307
|
+
"Utar's Barrows",
|
|
308
|
+
],
|
|
309
|
+
'Jewel Hills': ['Copper Grove', 'Duwani', 'The Decaying Wilds', "Utar's Barrows"],
|
|
310
|
+
"Utar's Barrows": [
|
|
311
|
+
'Duwani',
|
|
312
|
+
'Greater Tombstones',
|
|
313
|
+
'Jewel Hills',
|
|
314
|
+
'Lake of Songs',
|
|
315
|
+
'Lesser Tombstones',
|
|
316
|
+
'The Decaying Wilds',
|
|
317
|
+
],
|
|
318
|
+
Duwani: ['Jewel Hills', 'Lake of Songs', "Utar's Barrows"],
|
|
319
|
+
'Lesser Tombstones': [
|
|
320
|
+
'Big Sister',
|
|
321
|
+
'Greater Tombstones',
|
|
322
|
+
'Lake of Songs',
|
|
323
|
+
'Middle Sister',
|
|
324
|
+
'Three Rivers',
|
|
325
|
+
"Utar's Barrows",
|
|
326
|
+
],
|
|
327
|
+
'Lake of Songs': ['Duwani', 'Lesser Tombstones', 'Three Rivers', "Utar's Barrows"],
|
|
328
|
+
'Three Rivers': ['Lake of Songs', 'Lesser Tombstones', 'Middle Sister', 'Pine Barrens'],
|
|
329
|
+
};
|
|
330
|
+
/** The locations directly adjacent to `loc` (empty if `loc` is unknown). */
|
|
331
|
+
function neighborsOf(loc) {
|
|
332
|
+
var _a;
|
|
333
|
+
return (_a = exports.BOARD_ADJACENCY[loc]) !== null && _a !== void 0 ? _a : [];
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Breadth-first step distance between two locations. 0 to itself; `Infinity` if
|
|
337
|
+
* they are disconnected or either name is unknown.
|
|
338
|
+
*/
|
|
339
|
+
function stepDistance(a, b) {
|
|
340
|
+
if (a === b)
|
|
341
|
+
return 0;
|
|
342
|
+
const visited = new Set([a]);
|
|
343
|
+
let frontier = [a];
|
|
344
|
+
let dist = 0;
|
|
345
|
+
while (frontier.length > 0) {
|
|
346
|
+
dist++;
|
|
347
|
+
const next = [];
|
|
348
|
+
for (const node of frontier) {
|
|
349
|
+
for (const n of neighborsOf(node)) {
|
|
350
|
+
if (n === b)
|
|
351
|
+
return dist;
|
|
352
|
+
if (!visited.has(n)) {
|
|
353
|
+
visited.add(n);
|
|
354
|
+
next.push(n);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
frontier = next;
|
|
359
|
+
}
|
|
360
|
+
return Infinity;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Breadth-first shortest path between two locations, inclusive of both endpoints.
|
|
364
|
+
* `[a]` to itself; `[]` if they are disconnected or either name is unknown.
|
|
365
|
+
*/
|
|
366
|
+
function shortestPath(a, b) {
|
|
367
|
+
if (a === b)
|
|
368
|
+
return [a];
|
|
369
|
+
const prev = new Map();
|
|
370
|
+
const visited = new Set([a]);
|
|
371
|
+
let frontier = [a];
|
|
372
|
+
while (frontier.length > 0) {
|
|
373
|
+
const next = [];
|
|
374
|
+
for (const node of frontier) {
|
|
375
|
+
for (const n of neighborsOf(node)) {
|
|
376
|
+
if (visited.has(n))
|
|
377
|
+
continue;
|
|
378
|
+
visited.add(n);
|
|
379
|
+
prev.set(n, node);
|
|
380
|
+
if (n === b) {
|
|
381
|
+
const path = [b];
|
|
382
|
+
let cur = b;
|
|
383
|
+
while (cur !== undefined && cur !== a) {
|
|
384
|
+
cur = prev.get(cur);
|
|
385
|
+
if (cur !== undefined)
|
|
386
|
+
path.push(cur);
|
|
387
|
+
}
|
|
388
|
+
return path.reverse();
|
|
389
|
+
}
|
|
390
|
+
next.push(n);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
frontier = next;
|
|
394
|
+
}
|
|
395
|
+
return [];
|
|
396
|
+
}
|
|
397
|
+
//# sourceMappingURL=udtBoardAdjacency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"udtBoardAdjacency.js","sourceRoot":"","sources":["../../src/udtBoardAdjacency.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA+TH,kCAEC;AAMD,oCAoBC;AAMD,oCA2BC;AAxXD,kEAAkE;AACrD,QAAA,eAAe,GAAmB;IAC3C,gBAAgB,EAAE;QACd,cAAc;QACd,cAAc;QACd,UAAU;QACV,iBAAiB;QACjB,2BAA2B;QAC3B,cAAc;QACd,qBAAqB;KACxB;IACD,2BAA2B,EAAE;QACzB,gBAAgB;QAChB,cAAc;QACd,YAAY;QACZ,kBAAkB;QAClB,qBAAqB;KACxB;IACD,qBAAqB,EAAE;QACnB,cAAc;QACd,YAAY;QACZ,gBAAgB;QAChB,YAAY;QACZ,2BAA2B;KAC9B;IACD,cAAc,EAAE;QACZ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,IAAI,GAAG,CAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,IAAI,QAAQ,GAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC1B,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;oBAAE,SAAS;gBAC7B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACf,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;gBAClB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACV,MAAM,IAAI,GAAa,CAAC,CAAC,CAAC,CAAC;oBAC3B,IAAI,GAAG,GAAuB,CAAC,CAAC;oBAChC,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;wBACpC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACpB,IAAI,GAAG,KAAK,SAAS;4BAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBAC1C,CAAC;oBACD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC1B,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC;QACL,CAAC;QACD,QAAQ,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-slot layout anchors for the Return to Dark Tower board, plus board-image
|
|
3
|
+
* metadata. Each location carries one anchor per occupant slot type that can
|
|
4
|
+
* appear there (a building space adds 'building' + 'skull'); renderers fan
|
|
5
|
+
* multiple tokens around a single slot. Coordinates are normalized [0, 1] against
|
|
6
|
+
* the board image, so they are resolution-independent.
|
|
7
|
+
*
|
|
8
|
+
* GENERATED from tools/location-marker/udtBoardData.json by gen-board-data.mjs.
|
|
9
|
+
* Do not hand-edit — re-author in the location-marker tool and regenerate.
|
|
10
|
+
*/
|
|
11
|
+
export type Anchor = {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
export type AnchorSlot = 'building' | 'skull' | 'hero' | 'foe' | 'marker';
|
|
16
|
+
export type LocationAnchors = Partial<Record<AnchorSlot, Anchor>>;
|
|
17
|
+
export type BoardAnchorMap = Readonly<Record<string, LocationAnchors>>;
|
|
18
|
+
/**
|
|
19
|
+
* Board-image metadata so consumers can map normalized image coordinates onto a
|
|
20
|
+
* 2D canvas or the 3D disc. `northHeadingDegrees` is the image rotation that
|
|
21
|
+
* aligns image-north with the scene's north. A singleton for the four-kingdoms
|
|
22
|
+
* board (v1); the type leaves room for a future per-region map.
|
|
23
|
+
*/
|
|
24
|
+
export type BoardImageInfo = {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
centerX: number;
|
|
28
|
+
centerY: number;
|
|
29
|
+
radius: number;
|
|
30
|
+
northHeadingDegrees: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const BOARD_IMAGE_INFO: BoardImageInfo;
|
|
33
|
+
/** Layout anchors for all 60 board locations, keyed by location name. */
|
|
34
|
+
export declare const BOARD_ANCHORS: BoardAnchorMap;
|