@esengine/pathfinding 1.0.1 → 1.0.2

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.
@@ -0,0 +1,556 @@
1
+ /**
2
+ * @esengine/pathfinding v1.0.2
3
+ * 高性能寻路算法库 - 支持A*、广度优先等算法,适用于Cocos Creator、Laya等游戏引擎
4
+ *
5
+ * @author yhh
6
+ * @license MIT
7
+ */
8
+ (function (global, factory) {
9
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
10
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
11
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Pathfinding = {}));
12
+ })(this, (function (exports) { 'use strict';
13
+
14
+ var Vector2Utils = (function () {
15
+ function Vector2Utils() {
16
+ }
17
+ Vector2Utils.equals = function (a, b) {
18
+ if (a.equals) {
19
+ return a.equals(b);
20
+ }
21
+ return a.x === b.x && a.y === b.y;
22
+ };
23
+ Vector2Utils.create = function (x, y) {
24
+ return { x: x, y: y };
25
+ };
26
+ Vector2Utils.clone = function (vector) {
27
+ return { x: vector.x, y: vector.y };
28
+ };
29
+ Vector2Utils.add = function (a, b) {
30
+ return { x: a.x + b.x, y: a.y + b.y };
31
+ };
32
+ Vector2Utils.manhattanDistance = function (a, b) {
33
+ return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
34
+ };
35
+ Vector2Utils.distance = function (a, b) {
36
+ var dx = a.x - b.x;
37
+ var dy = a.y - b.y;
38
+ return Math.sqrt(dx * dx + dy * dy);
39
+ };
40
+ Vector2Utils.toHash = function (vector) {
41
+ var x = (vector.x + this.MAX_COORD) | 0;
42
+ var y = (vector.y + this.MAX_COORD) | 0;
43
+ return (x << 16) | y;
44
+ };
45
+ Vector2Utils.toKey = function (vector) {
46
+ return "".concat(vector.x, ",").concat(vector.y);
47
+ };
48
+ Vector2Utils.fromHash = function (hash) {
49
+ var x = (hash >> 16) - this.MAX_COORD;
50
+ var y = (hash & 0xFFFF) - this.MAX_COORD;
51
+ return { x: x, y: y };
52
+ };
53
+ Vector2Utils.HASH_MULTIPLIER = 73856093;
54
+ Vector2Utils.MAX_COORD = 32767;
55
+ return Vector2Utils;
56
+ }());
57
+
58
+ var PriorityQueue = (function () {
59
+ function PriorityQueue() {
60
+ this._heap = [];
61
+ this._size = 0;
62
+ }
63
+ Object.defineProperty(PriorityQueue.prototype, "size", {
64
+ get: function () {
65
+ return this._size;
66
+ },
67
+ enumerable: false,
68
+ configurable: true
69
+ });
70
+ Object.defineProperty(PriorityQueue.prototype, "isEmpty", {
71
+ get: function () {
72
+ return this._size === 0;
73
+ },
74
+ enumerable: false,
75
+ configurable: true
76
+ });
77
+ PriorityQueue.prototype.clear = function () {
78
+ this._heap.length = 0;
79
+ this._size = 0;
80
+ };
81
+ PriorityQueue.prototype.enqueue = function (item) {
82
+ this._heap[this._size] = item;
83
+ this._bubbleUp(this._size);
84
+ this._size++;
85
+ };
86
+ PriorityQueue.prototype.dequeue = function () {
87
+ if (this._size === 0) {
88
+ return undefined;
89
+ }
90
+ var result = this._heap[0];
91
+ this._size--;
92
+ if (this._size > 0) {
93
+ this._heap[0] = this._heap[this._size];
94
+ this._bubbleDown(0);
95
+ }
96
+ return result;
97
+ };
98
+ PriorityQueue.prototype.peek = function () {
99
+ return this._size > 0 ? this._heap[0] : undefined;
100
+ };
101
+ PriorityQueue.prototype._bubbleUp = function (index) {
102
+ while (index > 0) {
103
+ var parentIndex = Math.floor((index - 1) / 2);
104
+ if (this._heap[index].priority >= this._heap[parentIndex].priority) {
105
+ break;
106
+ }
107
+ this._swap(index, parentIndex);
108
+ index = parentIndex;
109
+ }
110
+ };
111
+ PriorityQueue.prototype._bubbleDown = function (index) {
112
+ while (true) {
113
+ var minIndex = index;
114
+ var leftChild = 2 * index + 1;
115
+ var rightChild = 2 * index + 2;
116
+ if (leftChild < this._size &&
117
+ this._heap[leftChild].priority < this._heap[minIndex].priority) {
118
+ minIndex = leftChild;
119
+ }
120
+ if (rightChild < this._size &&
121
+ this._heap[rightChild].priority < this._heap[minIndex].priority) {
122
+ minIndex = rightChild;
123
+ }
124
+ if (minIndex === index) {
125
+ break;
126
+ }
127
+ this._swap(index, minIndex);
128
+ index = minIndex;
129
+ }
130
+ };
131
+ PriorityQueue.prototype._swap = function (i, j) {
132
+ var temp = this._heap[i];
133
+ this._heap[i] = this._heap[j];
134
+ this._heap[j] = temp;
135
+ };
136
+ return PriorityQueue;
137
+ }());
138
+
139
+ var __spreadArray = (globalThis && globalThis.__spreadArray) || function (to, from, pack) {
140
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
141
+ if (ar || !(i in from)) {
142
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
143
+ ar[i] = from[i];
144
+ }
145
+ }
146
+ return to.concat(ar || Array.prototype.slice.call(from));
147
+ };
148
+ var AStarNode = (function () {
149
+ function AStarNode(node, gCost, hCost, parent) {
150
+ if (gCost === void 0) { gCost = 0; }
151
+ if (hCost === void 0) { hCost = 0; }
152
+ if (parent === void 0) { parent = null; }
153
+ this.priority = 0;
154
+ this.gCost = 0;
155
+ this.hCost = 0;
156
+ this.parent = null;
157
+ this.hash = 0;
158
+ this.node = node;
159
+ this.gCost = gCost;
160
+ this.hCost = hCost;
161
+ this.priority = gCost + hCost;
162
+ this.parent = parent;
163
+ this.hash = Vector2Utils.toHash(node);
164
+ }
165
+ AStarNode.prototype.updateCosts = function (gCost, hCost, parent) {
166
+ if (parent === void 0) { parent = null; }
167
+ this.gCost = gCost;
168
+ this.hCost = hCost;
169
+ this.priority = gCost + hCost;
170
+ this.parent = parent;
171
+ };
172
+ AStarNode.prototype.updateNode = function (node, gCost, hCost, parent) {
173
+ if (gCost === void 0) { gCost = 0; }
174
+ if (hCost === void 0) { hCost = 0; }
175
+ if (parent === void 0) { parent = null; }
176
+ this.node = node;
177
+ this.gCost = gCost;
178
+ this.hCost = hCost;
179
+ this.priority = gCost + hCost;
180
+ this.parent = parent;
181
+ this.hash = Vector2Utils.toHash(node);
182
+ };
183
+ AStarNode.prototype.reset = function () {
184
+ this.node = null;
185
+ this.priority = 0;
186
+ this.gCost = 0;
187
+ this.hCost = 0;
188
+ this.parent = null;
189
+ this.hash = 0;
190
+ };
191
+ return AStarNode;
192
+ }());
193
+ var AStarPathfinder = (function () {
194
+ function AStarPathfinder() {
195
+ }
196
+ AStarPathfinder._getNode = function (node, gCost, hCost, parent) {
197
+ if (gCost === void 0) { gCost = 0; }
198
+ if (hCost === void 0) { hCost = 0; }
199
+ if (parent === void 0) { parent = null; }
200
+ var astarNode = this._nodePool.pop();
201
+ if (!astarNode) {
202
+ astarNode = new AStarNode(node, gCost, hCost, parent);
203
+ }
204
+ else {
205
+ astarNode.updateNode(node, gCost, hCost, parent);
206
+ }
207
+ return astarNode;
208
+ };
209
+ AStarPathfinder._recycleNode = function (node) {
210
+ if (this._nodePool.length < 1000) {
211
+ node.reset();
212
+ this._nodePool.push(node);
213
+ }
214
+ };
215
+ AStarPathfinder.search = function (graph, start, goal) {
216
+ var openSet = new PriorityQueue();
217
+ var closedSet = new Set();
218
+ var openSetMap = new Map();
219
+ var startHash = Vector2Utils.toHash(start);
220
+ var goalHash = Vector2Utils.toHash(goal);
221
+ if (startHash === goalHash) {
222
+ return { found: true, goalNode: this._getNode(start, 0, 0) };
223
+ }
224
+ var startNode = this._getNode(start, 0, graph.heuristic(start, goal));
225
+ openSet.enqueue(startNode);
226
+ openSetMap.set(startHash, startNode);
227
+ var goalNode;
228
+ while (!openSet.isEmpty) {
229
+ var current = openSet.dequeue();
230
+ var currentHash = current.hash;
231
+ openSetMap.delete(currentHash);
232
+ if (currentHash === goalHash) {
233
+ goalNode = current;
234
+ break;
235
+ }
236
+ closedSet.add(currentHash);
237
+ for (var _i = 0, _a = graph.getNeighbors(current.node); _i < _a.length; _i++) {
238
+ var neighbor = _a[_i];
239
+ var neighborHash = Vector2Utils.toHash(neighbor);
240
+ if (closedSet.has(neighborHash)) {
241
+ continue;
242
+ }
243
+ var tentativeGScore = current.gCost + graph.cost(current.node, neighbor);
244
+ var existingNode = openSetMap.get(neighborHash);
245
+ if (existingNode) {
246
+ if (tentativeGScore < existingNode.gCost) {
247
+ var hCost = existingNode.hCost;
248
+ existingNode.updateCosts(tentativeGScore, hCost, current);
249
+ }
250
+ }
251
+ else {
252
+ var hCost = graph.heuristic(neighbor, goal);
253
+ var neighborNode = this._getNode(neighbor, tentativeGScore, hCost, current);
254
+ openSet.enqueue(neighborNode);
255
+ openSetMap.set(neighborHash, neighborNode);
256
+ }
257
+ }
258
+ if (current !== goalNode) {
259
+ this._recycleNode(current);
260
+ }
261
+ }
262
+ while (!openSet.isEmpty) {
263
+ var node = openSet.dequeue();
264
+ if (node !== goalNode) {
265
+ this._recycleNode(node);
266
+ }
267
+ }
268
+ return { found: !!goalNode, goalNode: goalNode };
269
+ };
270
+ AStarPathfinder.searchPath = function (graph, start, goal) {
271
+ var result = this.search(graph, start, goal);
272
+ if (!result.found || !result.goalNode) {
273
+ return [];
274
+ }
275
+ return this.reconstructPathFromNode(result.goalNode, start);
276
+ };
277
+ AStarPathfinder.reconstructPathFromNode = function (goalNode, start) {
278
+ this._tempPath.length = 0;
279
+ var current = goalNode;
280
+ var startHash = Vector2Utils.toHash(start);
281
+ while (current) {
282
+ this._tempPath.unshift(current.node);
283
+ var currentHash = current.hash;
284
+ var parent_1 = current.parent;
285
+ if (currentHash !== startHash) {
286
+ this._recycleNode(current);
287
+ }
288
+ current = parent_1;
289
+ }
290
+ return __spreadArray([], this._tempPath, true);
291
+ };
292
+ AStarPathfinder.hasPath = function (graph, start, goal) {
293
+ var result = this.search(graph, start, goal);
294
+ if (result.goalNode) {
295
+ this._recycleNode(result.goalNode);
296
+ }
297
+ return result.found;
298
+ };
299
+ AStarPathfinder.clearPool = function () {
300
+ this._nodePool.length = 0;
301
+ this._tempPath.length = 0;
302
+ };
303
+ AStarPathfinder.getPoolStats = function () {
304
+ return {
305
+ poolSize: this._nodePool.length,
306
+ maxPoolSize: 1000
307
+ };
308
+ };
309
+ AStarPathfinder._nodePool = [];
310
+ AStarPathfinder._tempPath = [];
311
+ return AStarPathfinder;
312
+ }());
313
+
314
+ var AstarGridGraph = (function () {
315
+ function AstarGridGraph(width, height) {
316
+ this.dirs = [
317
+ Vector2Utils.create(1, 0),
318
+ Vector2Utils.create(0, -1),
319
+ Vector2Utils.create(-1, 0),
320
+ Vector2Utils.create(0, 1)
321
+ ];
322
+ this.walls = [];
323
+ this.weightedNodes = [];
324
+ this.defaultWeight = 1;
325
+ this.weightedNodeWeight = 5;
326
+ this._neighbors = new Array(4);
327
+ this._wallsSet = new Set();
328
+ this._weightedNodesSet = new Set();
329
+ this._wallsDirty = true;
330
+ this._weightedNodesDirty = true;
331
+ this._width = width;
332
+ this._height = height;
333
+ }
334
+ AstarGridGraph.prototype.addWall = function (wall) {
335
+ this.walls.push(wall);
336
+ this._wallsDirty = true;
337
+ };
338
+ AstarGridGraph.prototype.addWalls = function (walls) {
339
+ var _a;
340
+ (_a = this.walls).push.apply(_a, walls);
341
+ this._wallsDirty = true;
342
+ };
343
+ AstarGridGraph.prototype.clearWalls = function () {
344
+ this.walls.length = 0;
345
+ this._wallsSet.clear();
346
+ this._wallsDirty = false;
347
+ };
348
+ AstarGridGraph.prototype.addWeightedNode = function (node) {
349
+ this.weightedNodes.push(node);
350
+ this._weightedNodesDirty = true;
351
+ };
352
+ AstarGridGraph.prototype.addWeightedNodes = function (nodes) {
353
+ var _a;
354
+ (_a = this.weightedNodes).push.apply(_a, nodes);
355
+ this._weightedNodesDirty = true;
356
+ };
357
+ AstarGridGraph.prototype.clearWeightedNodes = function () {
358
+ this.weightedNodes.length = 0;
359
+ this._weightedNodesSet.clear();
360
+ this._weightedNodesDirty = false;
361
+ };
362
+ AstarGridGraph.prototype._updateHashSets = function () {
363
+ if (this._wallsDirty) {
364
+ this._wallsSet.clear();
365
+ for (var _i = 0, _a = this.walls; _i < _a.length; _i++) {
366
+ var wall = _a[_i];
367
+ this._wallsSet.add(Vector2Utils.toHash(wall));
368
+ }
369
+ this._wallsDirty = false;
370
+ }
371
+ if (this._weightedNodesDirty) {
372
+ this._weightedNodesSet.clear();
373
+ for (var _b = 0, _c = this.weightedNodes; _b < _c.length; _b++) {
374
+ var node = _c[_b];
375
+ this._weightedNodesSet.add(Vector2Utils.toHash(node));
376
+ }
377
+ this._weightedNodesDirty = false;
378
+ }
379
+ };
380
+ AstarGridGraph.prototype.isNodeInBounds = function (node) {
381
+ return 0 <= node.x && node.x < this._width && 0 <= node.y && node.y < this._height;
382
+ };
383
+ AstarGridGraph.prototype.isNodePassable = function (node) {
384
+ this._updateHashSets();
385
+ return !this._wallsSet.has(Vector2Utils.toHash(node));
386
+ };
387
+ AstarGridGraph.prototype.search = function (start, goal) {
388
+ return AStarPathfinder.hasPath(this, start, goal);
389
+ };
390
+ AstarGridGraph.prototype.searchPath = function (start, goal) {
391
+ return AStarPathfinder.searchPath(this, start, goal);
392
+ };
393
+ AstarGridGraph.prototype.getNeighbors = function (node) {
394
+ this._neighbors.length = 0;
395
+ for (var _i = 0, _a = this.dirs; _i < _a.length; _i++) {
396
+ var dir = _a[_i];
397
+ var next = Vector2Utils.add(node, dir);
398
+ if (this.isNodeInBounds(next) && this.isNodePassable(next)) {
399
+ this._neighbors.push(next);
400
+ }
401
+ }
402
+ return this._neighbors;
403
+ };
404
+ AstarGridGraph.prototype.cost = function (from, to) {
405
+ this._updateHashSets();
406
+ return this._weightedNodesSet.has(Vector2Utils.toHash(to)) ? this.weightedNodeWeight : this.defaultWeight;
407
+ };
408
+ AstarGridGraph.prototype.heuristic = function (node, goal) {
409
+ return Vector2Utils.manhattanDistance(node, goal);
410
+ };
411
+ AstarGridGraph.prototype.getStats = function () {
412
+ this._updateHashSets();
413
+ return {
414
+ walls: this.walls.length,
415
+ weightedNodes: this.weightedNodes.length,
416
+ gridSize: "".concat(this._width, "x").concat(this._height),
417
+ wallsSetSize: this._wallsSet.size,
418
+ weightedNodesSetSize: this._weightedNodesSet.size
419
+ };
420
+ };
421
+ return AstarGridGraph;
422
+ }());
423
+
424
+ var BreadthFirstPathfinder = (function () {
425
+ function BreadthFirstPathfinder() {
426
+ }
427
+ BreadthFirstPathfinder.search = function (graph, start, goal, cameFrom) {
428
+ var frontier = [];
429
+ var visited = new Set();
430
+ var pathMap = cameFrom || new Map();
431
+ var startHash = Vector2Utils.toHash(start);
432
+ var goalHash = Vector2Utils.toHash(goal);
433
+ if (startHash === goalHash) {
434
+ return true;
435
+ }
436
+ frontier.push(start);
437
+ visited.add(startHash);
438
+ while (frontier.length > 0) {
439
+ var current = frontier.shift();
440
+ var currentHash = Vector2Utils.toHash(current);
441
+ if (currentHash === goalHash) {
442
+ return true;
443
+ }
444
+ for (var _i = 0, _a = graph.getNeighbors(current); _i < _a.length; _i++) {
445
+ var neighbor = _a[_i];
446
+ var neighborHash = Vector2Utils.toHash(neighbor);
447
+ if (visited.has(neighborHash)) {
448
+ continue;
449
+ }
450
+ visited.add(neighborHash);
451
+ pathMap.set(neighborHash, current);
452
+ frontier.push(neighbor);
453
+ }
454
+ }
455
+ return false;
456
+ };
457
+ BreadthFirstPathfinder.searchPath = function (graph, start, goal) {
458
+ var cameFrom = new Map();
459
+ if (this.search(graph, start, goal, cameFrom)) {
460
+ return this.reconstructPath(cameFrom, start, goal);
461
+ }
462
+ return [];
463
+ };
464
+ BreadthFirstPathfinder.reconstructPath = function (cameFrom, start, goal) {
465
+ var path = [];
466
+ var current = goal;
467
+ var startHash = Vector2Utils.toHash(start);
468
+ while (Vector2Utils.toHash(current) !== startHash) {
469
+ path.unshift(current);
470
+ var currentHash = Vector2Utils.toHash(current);
471
+ var parent_1 = cameFrom.get(currentHash);
472
+ if (!parent_1)
473
+ break;
474
+ current = parent_1;
475
+ }
476
+ path.unshift(start);
477
+ return path;
478
+ };
479
+ return BreadthFirstPathfinder;
480
+ }());
481
+
482
+ var UnweightedGraph = (function () {
483
+ function UnweightedGraph() {
484
+ this.edges = new Map();
485
+ }
486
+ UnweightedGraph.prototype.addEdgesForNode = function (node, neighbors) {
487
+ this.edges.set(node, neighbors);
488
+ return this;
489
+ };
490
+ UnweightedGraph.prototype.getNeighbors = function (node) {
491
+ return this.edges.get(node) || [];
492
+ };
493
+ return UnweightedGraph;
494
+ }());
495
+
496
+ var UnweightedGridGraph = (function () {
497
+ function UnweightedGridGraph(width, height, allowDiagonalSearch) {
498
+ if (allowDiagonalSearch === void 0) { allowDiagonalSearch = false; }
499
+ this.walls = [];
500
+ this._neighbors = [];
501
+ this._width = width;
502
+ this._height = height;
503
+ this._dirs = allowDiagonalSearch ? UnweightedGridGraph.COMPASS_DIRS : UnweightedGridGraph.CARDINAL_DIRS;
504
+ }
505
+ UnweightedGridGraph.prototype.isNodeInBounds = function (node) {
506
+ return 0 <= node.x && node.x < this._width && 0 <= node.y && node.y < this._height;
507
+ };
508
+ UnweightedGridGraph.prototype.isNodePassable = function (node) {
509
+ return !this.walls.find(function (wall) { return Vector2Utils.equals(wall, node); });
510
+ };
511
+ UnweightedGridGraph.prototype.getNeighbors = function (node) {
512
+ this._neighbors.length = 0;
513
+ for (var _i = 0, _a = this._dirs; _i < _a.length; _i++) {
514
+ var dir = _a[_i];
515
+ var next = Vector2Utils.add(node, dir);
516
+ if (this.isNodeInBounds(next) && this.isNodePassable(next)) {
517
+ this._neighbors.push(next);
518
+ }
519
+ }
520
+ return this._neighbors;
521
+ };
522
+ UnweightedGridGraph.prototype.searchPath = function (start, goal) {
523
+ return BreadthFirstPathfinder.searchPath(this, start, goal);
524
+ };
525
+ UnweightedGridGraph.prototype.hasPath = function (start, goal) {
526
+ return BreadthFirstPathfinder.search(this, start, goal);
527
+ };
528
+ UnweightedGridGraph.CARDINAL_DIRS = [
529
+ Vector2Utils.create(1, 0),
530
+ Vector2Utils.create(0, -1),
531
+ Vector2Utils.create(-1, 0),
532
+ Vector2Utils.create(0, 1)
533
+ ];
534
+ UnweightedGridGraph.COMPASS_DIRS = [
535
+ Vector2Utils.create(1, 0),
536
+ Vector2Utils.create(1, -1),
537
+ Vector2Utils.create(0, -1),
538
+ Vector2Utils.create(-1, -1),
539
+ Vector2Utils.create(-1, 0),
540
+ Vector2Utils.create(-1, 1),
541
+ Vector2Utils.create(0, 1),
542
+ Vector2Utils.create(1, 1),
543
+ ];
544
+ return UnweightedGridGraph;
545
+ }());
546
+
547
+ exports.AStarPathfinder = AStarPathfinder;
548
+ exports.AstarGridGraph = AstarGridGraph;
549
+ exports.BreadthFirstPathfinder = BreadthFirstPathfinder;
550
+ exports.PriorityQueue = PriorityQueue;
551
+ exports.UnweightedGraph = UnweightedGraph;
552
+ exports.UnweightedGridGraph = UnweightedGridGraph;
553
+ exports.Vector2Utils = Vector2Utils;
554
+
555
+ }));
556
+ //# sourceMappingURL=pathfinding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathfinding.js","sources":["../bin/Types/IVector2.js","../bin/Utils/PriorityQueue.js","../bin/AI/Pathfinding/AStar/AStarPathfinder.js","../bin/AI/Pathfinding/AStar/AstarGridGraph.js","../bin/AI/Pathfinding/BreadthFirst/BreadthFirstPathfinder.js","../bin/AI/Pathfinding/BreadthFirst/UnweightedGraph.js","../bin/AI/Pathfinding/BreadthFirst/UnweightedGridGraph.js"],"sourcesContent":["var Vector2Utils = (function () {\n function Vector2Utils() {\n }\n Vector2Utils.equals = function (a, b) {\n if (a.equals) {\n return a.equals(b);\n }\n return a.x === b.x && a.y === b.y;\n };\n Vector2Utils.create = function (x, y) {\n return { x: x, y: y };\n };\n Vector2Utils.clone = function (vector) {\n return { x: vector.x, y: vector.y };\n };\n Vector2Utils.add = function (a, b) {\n return { x: a.x + b.x, y: a.y + b.y };\n };\n Vector2Utils.manhattanDistance = function (a, b) {\n return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);\n };\n Vector2Utils.distance = function (a, b) {\n var dx = a.x - b.x;\n var dy = a.y - b.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n Vector2Utils.toHash = function (vector) {\n var x = (vector.x + this.MAX_COORD) | 0;\n var y = (vector.y + this.MAX_COORD) | 0;\n return (x << 16) | y;\n };\n Vector2Utils.toKey = function (vector) {\n return \"\".concat(vector.x, \",\").concat(vector.y);\n };\n Vector2Utils.fromHash = function (hash) {\n var x = (hash >> 16) - this.MAX_COORD;\n var y = (hash & 0xFFFF) - this.MAX_COORD;\n return { x: x, y: y };\n };\n Vector2Utils.HASH_MULTIPLIER = 73856093;\n Vector2Utils.MAX_COORD = 32767;\n return Vector2Utils;\n}());\nexport { Vector2Utils };\n","var PriorityQueue = (function () {\n function PriorityQueue() {\n this._heap = [];\n this._size = 0;\n }\n Object.defineProperty(PriorityQueue.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(PriorityQueue.prototype, \"isEmpty\", {\n get: function () {\n return this._size === 0;\n },\n enumerable: false,\n configurable: true\n });\n PriorityQueue.prototype.clear = function () {\n this._heap.length = 0;\n this._size = 0;\n };\n PriorityQueue.prototype.enqueue = function (item) {\n this._heap[this._size] = item;\n this._bubbleUp(this._size);\n this._size++;\n };\n PriorityQueue.prototype.dequeue = function () {\n if (this._size === 0) {\n return undefined;\n }\n var result = this._heap[0];\n this._size--;\n if (this._size > 0) {\n this._heap[0] = this._heap[this._size];\n this._bubbleDown(0);\n }\n return result;\n };\n PriorityQueue.prototype.peek = function () {\n return this._size > 0 ? this._heap[0] : undefined;\n };\n PriorityQueue.prototype._bubbleUp = function (index) {\n while (index > 0) {\n var parentIndex = Math.floor((index - 1) / 2);\n if (this._heap[index].priority >= this._heap[parentIndex].priority) {\n break;\n }\n this._swap(index, parentIndex);\n index = parentIndex;\n }\n };\n PriorityQueue.prototype._bubbleDown = function (index) {\n while (true) {\n var minIndex = index;\n var leftChild = 2 * index + 1;\n var rightChild = 2 * index + 2;\n if (leftChild < this._size &&\n this._heap[leftChild].priority < this._heap[minIndex].priority) {\n minIndex = leftChild;\n }\n if (rightChild < this._size &&\n this._heap[rightChild].priority < this._heap[minIndex].priority) {\n minIndex = rightChild;\n }\n if (minIndex === index) {\n break;\n }\n this._swap(index, minIndex);\n index = minIndex;\n }\n };\n PriorityQueue.prototype._swap = function (i, j) {\n var temp = this._heap[i];\n this._heap[i] = this._heap[j];\n this._heap[j] = temp;\n };\n return PriorityQueue;\n}());\nexport { PriorityQueue };\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { Vector2Utils } from '../../../Types/IVector2';\nimport { PriorityQueue } from '../../../Utils/PriorityQueue';\nvar AStarNode = (function () {\n function AStarNode(node, gCost, hCost, parent) {\n if (gCost === void 0) { gCost = 0; }\n if (hCost === void 0) { hCost = 0; }\n if (parent === void 0) { parent = null; }\n this.priority = 0;\n this.gCost = 0;\n this.hCost = 0;\n this.parent = null;\n this.hash = 0;\n this.node = node;\n this.gCost = gCost;\n this.hCost = hCost;\n this.priority = gCost + hCost;\n this.parent = parent;\n this.hash = Vector2Utils.toHash(node);\n }\n AStarNode.prototype.updateCosts = function (gCost, hCost, parent) {\n if (parent === void 0) { parent = null; }\n this.gCost = gCost;\n this.hCost = hCost;\n this.priority = gCost + hCost;\n this.parent = parent;\n };\n AStarNode.prototype.updateNode = function (node, gCost, hCost, parent) {\n if (gCost === void 0) { gCost = 0; }\n if (hCost === void 0) { hCost = 0; }\n if (parent === void 0) { parent = null; }\n this.node = node;\n this.gCost = gCost;\n this.hCost = hCost;\n this.priority = gCost + hCost;\n this.parent = parent;\n this.hash = Vector2Utils.toHash(node);\n };\n AStarNode.prototype.reset = function () {\n this.node = null;\n this.priority = 0;\n this.gCost = 0;\n this.hCost = 0;\n this.parent = null;\n this.hash = 0;\n };\n return AStarNode;\n}());\nvar AStarPathfinder = (function () {\n function AStarPathfinder() {\n }\n AStarPathfinder._getNode = function (node, gCost, hCost, parent) {\n if (gCost === void 0) { gCost = 0; }\n if (hCost === void 0) { hCost = 0; }\n if (parent === void 0) { parent = null; }\n var astarNode = this._nodePool.pop();\n if (!astarNode) {\n astarNode = new AStarNode(node, gCost, hCost, parent);\n }\n else {\n astarNode.updateNode(node, gCost, hCost, parent);\n }\n return astarNode;\n };\n AStarPathfinder._recycleNode = function (node) {\n if (this._nodePool.length < 1000) {\n node.reset();\n this._nodePool.push(node);\n }\n };\n AStarPathfinder.search = function (graph, start, goal) {\n var openSet = new PriorityQueue();\n var closedSet = new Set();\n var openSetMap = new Map();\n var startHash = Vector2Utils.toHash(start);\n var goalHash = Vector2Utils.toHash(goal);\n if (startHash === goalHash) {\n return { found: true, goalNode: this._getNode(start, 0, 0) };\n }\n var startNode = this._getNode(start, 0, graph.heuristic(start, goal));\n openSet.enqueue(startNode);\n openSetMap.set(startHash, startNode);\n var goalNode;\n while (!openSet.isEmpty) {\n var current = openSet.dequeue();\n var currentHash = current.hash;\n openSetMap.delete(currentHash);\n if (currentHash === goalHash) {\n goalNode = current;\n break;\n }\n closedSet.add(currentHash);\n for (var _i = 0, _a = graph.getNeighbors(current.node); _i < _a.length; _i++) {\n var neighbor = _a[_i];\n var neighborHash = Vector2Utils.toHash(neighbor);\n if (closedSet.has(neighborHash)) {\n continue;\n }\n var tentativeGScore = current.gCost + graph.cost(current.node, neighbor);\n var existingNode = openSetMap.get(neighborHash);\n if (existingNode) {\n if (tentativeGScore < existingNode.gCost) {\n var hCost = existingNode.hCost;\n existingNode.updateCosts(tentativeGScore, hCost, current);\n }\n }\n else {\n var hCost = graph.heuristic(neighbor, goal);\n var neighborNode = this._getNode(neighbor, tentativeGScore, hCost, current);\n openSet.enqueue(neighborNode);\n openSetMap.set(neighborHash, neighborNode);\n }\n }\n if (current !== goalNode) {\n this._recycleNode(current);\n }\n }\n while (!openSet.isEmpty) {\n var node = openSet.dequeue();\n if (node !== goalNode) {\n this._recycleNode(node);\n }\n }\n return { found: !!goalNode, goalNode: goalNode };\n };\n AStarPathfinder.searchPath = function (graph, start, goal) {\n var result = this.search(graph, start, goal);\n if (!result.found || !result.goalNode) {\n return [];\n }\n return this.reconstructPathFromNode(result.goalNode, start);\n };\n AStarPathfinder.reconstructPathFromNode = function (goalNode, start) {\n this._tempPath.length = 0;\n var current = goalNode;\n var startHash = Vector2Utils.toHash(start);\n while (current) {\n this._tempPath.unshift(current.node);\n var currentHash = current.hash;\n var parent_1 = current.parent;\n if (currentHash !== startHash) {\n this._recycleNode(current);\n }\n current = parent_1;\n }\n return __spreadArray([], this._tempPath, true);\n };\n AStarPathfinder.hasPath = function (graph, start, goal) {\n var result = this.search(graph, start, goal);\n if (result.goalNode) {\n this._recycleNode(result.goalNode);\n }\n return result.found;\n };\n AStarPathfinder.clearPool = function () {\n this._nodePool.length = 0;\n this._tempPath.length = 0;\n };\n AStarPathfinder.getPoolStats = function () {\n return {\n poolSize: this._nodePool.length,\n maxPoolSize: 1000\n };\n };\n AStarPathfinder._nodePool = [];\n AStarPathfinder._tempPath = [];\n return AStarPathfinder;\n}());\nexport { AStarPathfinder };\n","import { Vector2Utils } from '../../../Types/IVector2';\nimport { AStarPathfinder } from './AStarPathfinder';\nvar AstarGridGraph = (function () {\n function AstarGridGraph(width, height) {\n this.dirs = [\n Vector2Utils.create(1, 0),\n Vector2Utils.create(0, -1),\n Vector2Utils.create(-1, 0),\n Vector2Utils.create(0, 1)\n ];\n this.walls = [];\n this.weightedNodes = [];\n this.defaultWeight = 1;\n this.weightedNodeWeight = 5;\n this._neighbors = new Array(4);\n this._wallsSet = new Set();\n this._weightedNodesSet = new Set();\n this._wallsDirty = true;\n this._weightedNodesDirty = true;\n this._width = width;\n this._height = height;\n }\n AstarGridGraph.prototype.addWall = function (wall) {\n this.walls.push(wall);\n this._wallsDirty = true;\n };\n AstarGridGraph.prototype.addWalls = function (walls) {\n var _a;\n (_a = this.walls).push.apply(_a, walls);\n this._wallsDirty = true;\n };\n AstarGridGraph.prototype.clearWalls = function () {\n this.walls.length = 0;\n this._wallsSet.clear();\n this._wallsDirty = false;\n };\n AstarGridGraph.prototype.addWeightedNode = function (node) {\n this.weightedNodes.push(node);\n this._weightedNodesDirty = true;\n };\n AstarGridGraph.prototype.addWeightedNodes = function (nodes) {\n var _a;\n (_a = this.weightedNodes).push.apply(_a, nodes);\n this._weightedNodesDirty = true;\n };\n AstarGridGraph.prototype.clearWeightedNodes = function () {\n this.weightedNodes.length = 0;\n this._weightedNodesSet.clear();\n this._weightedNodesDirty = false;\n };\n AstarGridGraph.prototype._updateHashSets = function () {\n if (this._wallsDirty) {\n this._wallsSet.clear();\n for (var _i = 0, _a = this.walls; _i < _a.length; _i++) {\n var wall = _a[_i];\n this._wallsSet.add(Vector2Utils.toHash(wall));\n }\n this._wallsDirty = false;\n }\n if (this._weightedNodesDirty) {\n this._weightedNodesSet.clear();\n for (var _b = 0, _c = this.weightedNodes; _b < _c.length; _b++) {\n var node = _c[_b];\n this._weightedNodesSet.add(Vector2Utils.toHash(node));\n }\n this._weightedNodesDirty = false;\n }\n };\n AstarGridGraph.prototype.isNodeInBounds = function (node) {\n return 0 <= node.x && node.x < this._width && 0 <= node.y && node.y < this._height;\n };\n AstarGridGraph.prototype.isNodePassable = function (node) {\n this._updateHashSets();\n return !this._wallsSet.has(Vector2Utils.toHash(node));\n };\n AstarGridGraph.prototype.search = function (start, goal) {\n return AStarPathfinder.hasPath(this, start, goal);\n };\n AstarGridGraph.prototype.searchPath = function (start, goal) {\n return AStarPathfinder.searchPath(this, start, goal);\n };\n AstarGridGraph.prototype.getNeighbors = function (node) {\n this._neighbors.length = 0;\n for (var _i = 0, _a = this.dirs; _i < _a.length; _i++) {\n var dir = _a[_i];\n var next = Vector2Utils.add(node, dir);\n if (this.isNodeInBounds(next) && this.isNodePassable(next)) {\n this._neighbors.push(next);\n }\n }\n return this._neighbors;\n };\n AstarGridGraph.prototype.cost = function (from, to) {\n this._updateHashSets();\n return this._weightedNodesSet.has(Vector2Utils.toHash(to)) ? this.weightedNodeWeight : this.defaultWeight;\n };\n AstarGridGraph.prototype.heuristic = function (node, goal) {\n return Vector2Utils.manhattanDistance(node, goal);\n };\n AstarGridGraph.prototype.getStats = function () {\n this._updateHashSets();\n return {\n walls: this.walls.length,\n weightedNodes: this.weightedNodes.length,\n gridSize: \"\".concat(this._width, \"x\").concat(this._height),\n wallsSetSize: this._wallsSet.size,\n weightedNodesSetSize: this._weightedNodesSet.size\n };\n };\n return AstarGridGraph;\n}());\nexport { AstarGridGraph };\n","import { Vector2Utils } from '../../../Types/IVector2';\nvar BreadthFirstPathfinder = (function () {\n function BreadthFirstPathfinder() {\n }\n BreadthFirstPathfinder.search = function (graph, start, goal, cameFrom) {\n var frontier = [];\n var visited = new Set();\n var pathMap = cameFrom || new Map();\n var startHash = Vector2Utils.toHash(start);\n var goalHash = Vector2Utils.toHash(goal);\n if (startHash === goalHash) {\n return true;\n }\n frontier.push(start);\n visited.add(startHash);\n while (frontier.length > 0) {\n var current = frontier.shift();\n var currentHash = Vector2Utils.toHash(current);\n if (currentHash === goalHash) {\n return true;\n }\n for (var _i = 0, _a = graph.getNeighbors(current); _i < _a.length; _i++) {\n var neighbor = _a[_i];\n var neighborHash = Vector2Utils.toHash(neighbor);\n if (visited.has(neighborHash)) {\n continue;\n }\n visited.add(neighborHash);\n pathMap.set(neighborHash, current);\n frontier.push(neighbor);\n }\n }\n return false;\n };\n BreadthFirstPathfinder.searchPath = function (graph, start, goal) {\n var cameFrom = new Map();\n if (this.search(graph, start, goal, cameFrom)) {\n return this.reconstructPath(cameFrom, start, goal);\n }\n return [];\n };\n BreadthFirstPathfinder.reconstructPath = function (cameFrom, start, goal) {\n var path = [];\n var current = goal;\n var startHash = Vector2Utils.toHash(start);\n while (Vector2Utils.toHash(current) !== startHash) {\n path.unshift(current);\n var currentHash = Vector2Utils.toHash(current);\n var parent_1 = cameFrom.get(currentHash);\n if (!parent_1)\n break;\n current = parent_1;\n }\n path.unshift(start);\n return path;\n };\n return BreadthFirstPathfinder;\n}());\nexport { BreadthFirstPathfinder };\n","var UnweightedGraph = (function () {\n function UnweightedGraph() {\n this.edges = new Map();\n }\n UnweightedGraph.prototype.addEdgesForNode = function (node, neighbors) {\n this.edges.set(node, neighbors);\n return this;\n };\n UnweightedGraph.prototype.getNeighbors = function (node) {\n return this.edges.get(node) || [];\n };\n return UnweightedGraph;\n}());\nexport { UnweightedGraph };\n","import { Vector2Utils } from '../../../Types/IVector2';\nimport { BreadthFirstPathfinder } from './BreadthFirstPathfinder';\nvar UnweightedGridGraph = (function () {\n function UnweightedGridGraph(width, height, allowDiagonalSearch) {\n if (allowDiagonalSearch === void 0) { allowDiagonalSearch = false; }\n this.walls = [];\n this._neighbors = [];\n this._width = width;\n this._height = height;\n this._dirs = allowDiagonalSearch ? UnweightedGridGraph.COMPASS_DIRS : UnweightedGridGraph.CARDINAL_DIRS;\n }\n UnweightedGridGraph.prototype.isNodeInBounds = function (node) {\n return 0 <= node.x && node.x < this._width && 0 <= node.y && node.y < this._height;\n };\n UnweightedGridGraph.prototype.isNodePassable = function (node) {\n return !this.walls.find(function (wall) { return Vector2Utils.equals(wall, node); });\n };\n UnweightedGridGraph.prototype.getNeighbors = function (node) {\n this._neighbors.length = 0;\n for (var _i = 0, _a = this._dirs; _i < _a.length; _i++) {\n var dir = _a[_i];\n var next = Vector2Utils.add(node, dir);\n if (this.isNodeInBounds(next) && this.isNodePassable(next)) {\n this._neighbors.push(next);\n }\n }\n return this._neighbors;\n };\n UnweightedGridGraph.prototype.searchPath = function (start, goal) {\n return BreadthFirstPathfinder.searchPath(this, start, goal);\n };\n UnweightedGridGraph.prototype.hasPath = function (start, goal) {\n return BreadthFirstPathfinder.search(this, start, goal);\n };\n UnweightedGridGraph.CARDINAL_DIRS = [\n Vector2Utils.create(1, 0),\n Vector2Utils.create(0, -1),\n Vector2Utils.create(-1, 0),\n Vector2Utils.create(0, 1)\n ];\n UnweightedGridGraph.COMPASS_DIRS = [\n Vector2Utils.create(1, 0),\n Vector2Utils.create(1, -1),\n Vector2Utils.create(0, -1),\n Vector2Utils.create(-1, -1),\n Vector2Utils.create(-1, 0),\n Vector2Utils.create(-1, 1),\n Vector2Utils.create(0, 1),\n Vector2Utils.create(1, 1),\n ];\n return UnweightedGridGraph;\n}());\nexport { UnweightedGridGraph };\n"],"names":["this"],"mappings":";;;;;;;;;;;;;AAAG,QAAC,YAAY,IAAI,YAAY;IAChC,IAAI,SAAS,YAAY,GAAG;IAC5B;IACA,IAAI,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;IAC1C,QAAQ,IAAI,CAAC,CAAC,MAAM,EAAE;IACtB,YAAY,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9B;IACA,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,KAAK;IACL,IAAI,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;IAC1C,QAAQ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC7B,KAAK;IACL,IAAI,YAAY,CAAC,KAAK,GAAG,UAAU,MAAM,EAAE;IAC3C,QAAQ,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE;IAC3C,KAAK;IACL,IAAI,YAAY,CAAC,GAAG,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;IACvC,QAAQ,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;IAC7C,KAAK;IACL,IAAI,YAAY,CAAC,iBAAiB,GAAG,UAAU,CAAC,EAAE,CAAC,EA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