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