@esengine/pathfinding 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -1,13 +1,18 @@
1
1
  # 寻路算法库
2
2
 
3
+ [![CI](https://img.shields.io/badge/CI-passing-brightgreen)](https://github.com/esengine/ecs-astar/actions)
4
+ [![npm版本](https://img.shields.io/npm/v/@esengine/pathfinding.svg)](https://www.npmjs.com/package/@esengine/pathfinding)
5
+ [![测试覆盖率](https://img.shields.io/badge/coverage-87.39%25-green)](https://github.com/esengine/ecs-astar)
6
+ [![许可证](https://img.shields.io/npm/l/@esengine/pathfinding.svg)](https://github.com/esengine/ecs-astar/blob/main/LICENSE)
7
+
3
8
  适用于Cocos Creator和Laya引擎的寻路算法库,支持A*和广度优先搜索算法。
4
9
 
5
- ## 特性
10
+ ## 特性
6
11
 
7
12
  - **多算法支持**:A*、广度优先搜索
8
13
  - **引擎兼容**:支持Cocos Creator和Laya引擎
9
14
  - **TypeScript**:完整的类型定义
10
- - **模块化**:支持按需加载
15
+ - **高性能**:对象池优化,减少GC压力
11
16
 
12
17
  ## 安装
13
18
 
@@ -1,11 +1,11 @@
1
- // 广度优先搜索算法模块 v1.0.1
2
- export { Vector2Utils } from './Types/IVector2';
3
- export { PriorityQueue } from './Utils/PriorityQueue';
4
- export { AStarPathfinder } from './AI/Pathfinding/AStar/AStarPathfinder';
5
- export { AstarGridGraph } from './AI/Pathfinding/AStar/AstarGridGraph';
6
- export { BreadthFirstPathfinder } from './AI/Pathfinding/BreadthFirst/BreadthFirstPathfinder';
7
- export { UnweightedGraph } from './AI/Pathfinding/BreadthFirst/UnweightedGraph';
8
- export { UnweightedGridGraph } from './AI/Pathfinding/BreadthFirst/UnweightedGridGraph';
1
+ /**
2
+ * @esengine/pathfinding v1.0.3
3
+ * 高性能寻路算法库 - 支持A*、广度优先等算法,适用于Cocos Creator、Laya等游戏引擎
4
+ *
5
+ * @author yhh
6
+ * @license MIT
7
+ */
8
+ 'use strict';
9
9
 
10
10
  var Vector2Utils = (function () {
11
11
  function Vector2Utils() {
@@ -50,7 +50,6 @@ var Vector2Utils = (function () {
50
50
  Vector2Utils.MAX_COORD = 32767;
51
51
  return Vector2Utils;
52
52
  }());
53
- export { Vector2Utils };
54
53
 
55
54
  var PriorityQueue = (function () {
56
55
  function PriorityQueue() {
@@ -132,9 +131,8 @@ var PriorityQueue = (function () {
132
131
  };
133
132
  return PriorityQueue;
134
133
  }());
135
- export { PriorityQueue };
136
134
 
137
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
135
+ var __spreadArray = (globalThis && globalThis.__spreadArray) || function (to, from, pack) {
138
136
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
139
137
  if (ar || !(i in from)) {
140
138
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -143,8 +141,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
143
141
  }
144
142
  return to.concat(ar || Array.prototype.slice.call(from));
145
143
  };
146
- import { Vector2Utils } from '../../../Types/IVector2';
147
- import { PriorityQueue } from '../../../Utils/PriorityQueue';
148
144
  var AStarNode = (function () {
149
145
  function AStarNode(node, gCost, hCost, parent) {
150
146
  if (gCost === void 0) { gCost = 0; }
@@ -221,10 +217,14 @@ var AStarPathfinder = (function () {
221
217
  if (startHash === goalHash) {
222
218
  return { found: true, goalNode: this._getNode(start, 0, 0) };
223
219
  }
220
+ if (!graph.isNodePassable(start)) {
221
+ return { found: false, openSetNodes: [] };
222
+ }
224
223
  var startNode = this._getNode(start, 0, graph.heuristic(start, goal));
225
224
  openSet.enqueue(startNode);
226
225
  openSetMap.set(startHash, startNode);
227
226
  var goalNode;
227
+ var processedNodes = [];
228
228
  while (!openSet.isEmpty) {
229
229
  var current = openSet.dequeue();
230
230
  var currentHash = current.hash;
@@ -255,37 +255,41 @@ var AStarPathfinder = (function () {
255
255
  openSetMap.set(neighborHash, neighborNode);
256
256
  }
257
257
  }
258
- if (current !== goalNode) {
259
- this._recycleNode(current);
260
- }
258
+ processedNodes.push(current);
261
259
  }
260
+ var remainingNodes = [];
262
261
  while (!openSet.isEmpty) {
263
- var node = openSet.dequeue();
264
- if (node !== goalNode) {
265
- this._recycleNode(node);
266
- }
262
+ remainingNodes.push(openSet.dequeue());
267
263
  }
268
- return { found: !!goalNode, goalNode: goalNode };
264
+ var allNodesToRecycle = __spreadArray(__spreadArray([], processedNodes, true), remainingNodes, true);
265
+ return { found: !!goalNode, goalNode: goalNode, openSetNodes: allNodesToRecycle };
269
266
  };
270
267
  AStarPathfinder.searchPath = function (graph, start, goal) {
271
268
  var result = this.search(graph, start, goal);
272
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
+ }
273
276
  return [];
274
277
  }
275
- return this.reconstructPathFromNode(result.goalNode, start);
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;
276
286
  };
277
- AStarPathfinder.reconstructPathFromNode = function (goalNode, start) {
287
+ AStarPathfinder.reconstructPathFromNode = function (goalNode) {
278
288
  this._tempPath.length = 0;
279
289
  var current = goalNode;
280
- var startHash = Vector2Utils.toHash(start);
281
290
  while (current) {
282
291
  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;
292
+ current = current.parent;
289
293
  }
290
294
  return __spreadArray([], this._tempPath, true);
291
295
  };
@@ -294,6 +298,14 @@ var AStarPathfinder = (function () {
294
298
  if (result.goalNode) {
295
299
  this._recycleNode(result.goalNode);
296
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
+ }
297
309
  return result.found;
298
310
  };
299
311
  AStarPathfinder.clearPool = function () {
@@ -310,10 +322,7 @@ var AStarPathfinder = (function () {
310
322
  AStarPathfinder._tempPath = [];
311
323
  return AStarPathfinder;
312
324
  }());
313
- export { AStarPathfinder };
314
325
 
315
- import { Vector2Utils } from '../../../Types/IVector2';
316
- import { AStarPathfinder } from './AStarPathfinder';
317
326
  var AstarGridGraph = (function () {
318
327
  function AstarGridGraph(width, height) {
319
328
  this.dirs = [
@@ -423,11 +432,7 @@ var AstarGridGraph = (function () {
423
432
  };
424
433
  return AstarGridGraph;
425
434
  }());
426
- export { AstarGridGraph };
427
-
428
- export {};
429
435
 
430
- import { Vector2Utils } from '../../../Types/IVector2';
431
436
  var BreadthFirstPathfinder = (function () {
432
437
  function BreadthFirstPathfinder() {
433
438
  }
@@ -485,9 +490,6 @@ var BreadthFirstPathfinder = (function () {
485
490
  };
486
491
  return BreadthFirstPathfinder;
487
492
  }());
488
- export { BreadthFirstPathfinder };
489
-
490
- export {};
491
493
 
492
494
  var UnweightedGraph = (function () {
493
495
  function UnweightedGraph() {
@@ -502,10 +504,7 @@ var UnweightedGraph = (function () {
502
504
  };
503
505
  return UnweightedGraph;
504
506
  }());
505
- export { UnweightedGraph };
506
507
 
507
- import { Vector2Utils } from '../../../Types/IVector2';
508
- import { BreadthFirstPathfinder } from './BreadthFirstPathfinder';
509
508
  var UnweightedGridGraph = (function () {
510
509
  function UnweightedGridGraph(width, height, allowDiagonalSearch) {
511
510
  if (allowDiagonalSearch === void 0) { allowDiagonalSearch = false; }
@@ -556,4 +555,12 @@ var UnweightedGridGraph = (function () {
556
555
  ];
557
556
  return UnweightedGridGraph;
558
557
  }());
559
- export { UnweightedGridGraph };
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
@@ -0,0 +1 @@
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 Vector2Utils.create(0, 1),\n Vector2Utils.create(1, 1),\n ];\n return UnweightedGridGraph;\n}());\nexport { UnweightedGridGraph };\n"],"names":["this"],"mappings":";;;;;;;;;AAAG,IAAC,YAAY,IAAI,YAAY;AAChC,IAAI,SAAS,YAAY,GAAG;AAC5B,IAAI;AACJ,IAAI,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;AAC1C,QAAQ,IAAI,CAAC,CAAC,MAAM,EAAE;AACtB,YAAY,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,QAAQ;AACR,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,IAAI,CAAC;AACL,IAAI,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;AAC1C,QAAQ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC7B,IAAI,CAAC;AACL,IAAI,YAAY,CAAC,KAAK,GAAG,UAAU,MAAM,EAAE;AAC3C,QAAQ,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE;AAC3C,IAAI,CAAC;AACL,IAAI,YAAY,CAAC,GAAG,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;AACvC,QAAQ,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC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AAM,CAAC,CAAC,EAAE,CAAC;AAChC,KAAK;AACL,IAAI,mBAAmB,CAAC,YAAY,GAAG;AACvC,QAAQ,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,QAAQ,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;AAClC,QAAQ,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;AAClC,QAAQ,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AACnC,QAAQ,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAClC,QAAQ,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAClC,QAAQ,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,QAAQ,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,KAAK;AACL,IAAI,OAAO,mBAAmB;AAC9B,CAAC,EAAE;;;;;;;;;;"}
@@ -1,21 +1,15 @@
1
- export { IVector2, IComparableVector2, Vector2Utils } from './Types/IVector2';
2
- export { PriorityQueue, IPriorityQueueNode } from './Utils/PriorityQueue';
3
- export { IAstarGraph } from './AI/Pathfinding/AStar/IAstarGraph';
4
- export { AStarPathfinder } from './AI/Pathfinding/AStar/AStarPathfinder';
5
- export { AstarGridGraph } from './AI/Pathfinding/AStar/AstarGridGraph';
6
- export { IUnweightedGraph } from './AI/Pathfinding/BreadthFirst/IUnweightedGraph';
7
- export { BreadthFirstPathfinder } from './AI/Pathfinding/BreadthFirst/BreadthFirstPathfinder';
8
- export { UnweightedGraph } from './AI/Pathfinding/BreadthFirst/UnweightedGraph';
9
- export { UnweightedGridGraph } from './AI/Pathfinding/BreadthFirst/UnweightedGridGraph';
10
-
11
- export interface IVector2 {
1
+ /**
2
+ * @esengine/pathfinding v1.0.3
3
+ * TypeScript definitions
4
+ */
5
+ interface IVector2 {
12
6
  x: number;
13
7
  y: number;
14
8
  }
15
- export interface IComparableVector2 extends IVector2 {
9
+ interface IComparableVector2 extends IVector2 {
16
10
  equals?(other: IVector2): boolean;
17
11
  }
18
- export declare class Vector2Utils {
12
+ declare class Vector2Utils {
19
13
  private static readonly HASH_MULTIPLIER;
20
14
  private static readonly MAX_COORD;
21
15
  static equals(a: IVector2, b: IVector2): boolean;
@@ -29,10 +23,10 @@ export declare class Vector2Utils {
29
23
  static fromHash(hash: number): IVector2;
30
24
  }
31
25
 
32
- export interface IPriorityQueueNode {
26
+ interface IPriorityQueueNode {
33
27
  priority: number;
34
28
  }
35
- export declare class PriorityQueue<T extends IPriorityQueueNode> {
29
+ declare class PriorityQueue<T extends IPriorityQueueNode> {
36
30
  private _heap;
37
31
  private _size;
38
32
  get size(): number;
@@ -46,9 +40,13 @@ export declare class PriorityQueue<T extends IPriorityQueueNode> {
46
40
  private _swap;
47
41
  }
48
42
 
49
- import { IVector2 } from '../../../Types/IVector2';
50
- import { IAstarGraph } from './IAstarGraph';
51
- import { IPriorityQueueNode } from '../../../Utils/PriorityQueue';
43
+ interface IAstarGraph<T extends IVector2> {
44
+ getNeighbors(node: T): T[];
45
+ cost(from: T, to: T): number;
46
+ heuristic(node: T, goal: T): number;
47
+ isNodePassable(node: T): boolean;
48
+ }
49
+
52
50
  declare class AStarNode implements IPriorityQueueNode {
53
51
  node: IVector2;
54
52
  priority: number;
@@ -61,7 +59,7 @@ declare class AStarNode implements IPriorityQueueNode {
61
59
  updateNode(node: IVector2, gCost?: number, hCost?: number, parent?: AStarNode | null): void;
62
60
  reset(): void;
63
61
  }
64
- export declare class AStarPathfinder {
62
+ declare class AStarPathfinder {
65
63
  private static _nodePool;
66
64
  private static _tempPath;
67
65
  private static _getNode;
@@ -69,6 +67,7 @@ export declare class AStarPathfinder {
69
67
  static search<T extends IVector2>(graph: IAstarGraph<T>, start: T, goal: T): {
70
68
  found: boolean;
71
69
  goalNode?: AStarNode;
70
+ openSetNodes?: AStarNode[];
72
71
  };
73
72
  static searchPath<T extends IVector2>(graph: IAstarGraph<T>, start: T, goal: T): T[];
74
73
  private static reconstructPathFromNode;
@@ -79,11 +78,8 @@ export declare class AStarPathfinder {
79
78
  maxPoolSize: number;
80
79
  };
81
80
  }
82
- export {};
83
81
 
84
- import { IVector2 } from '../../../Types/IVector2';
85
- import { IAstarGraph } from './IAstarGraph';
86
- export declare class AstarGridGraph implements IAstarGraph<IVector2> {
82
+ declare class AstarGridGraph implements IAstarGraph<IVector2> {
87
83
  dirs: IVector2[];
88
84
  walls: IVector2[];
89
85
  weightedNodes: IVector2[];
@@ -120,37 +116,23 @@ export declare class AstarGridGraph implements IAstarGraph<IVector2> {
120
116
  };
121
117
  }
122
118
 
123
- import { IVector2 } from '../../../Types/IVector2';
124
- export interface IAstarGraph<T extends IVector2> {
119
+ interface IUnweightedGraph<T extends IVector2> {
125
120
  getNeighbors(node: T): T[];
126
- cost(from: T, to: T): number;
127
- heuristic(node: T, goal: T): number;
128
121
  }
129
122
 
130
- import { IVector2 } from '../../../Types/IVector2';
131
- import { IUnweightedGraph } from './IUnweightedGraph';
132
- export declare class BreadthFirstPathfinder {
123
+ declare class BreadthFirstPathfinder {
133
124
  static search<T extends IVector2>(graph: IUnweightedGraph<T>, start: T, goal: T, cameFrom?: Map<number, T>): boolean;
134
125
  static searchPath<T extends IVector2>(graph: IUnweightedGraph<T>, start: T, goal: T): T[];
135
126
  static reconstructPath<T extends IVector2>(cameFrom: Map<number, T>, start: T, goal: T): T[];
136
127
  }
137
128
 
138
- import { IVector2 } from '../../../Types/IVector2';
139
- export interface IUnweightedGraph<T extends IVector2> {
140
- getNeighbors(node: T): T[];
141
- }
142
-
143
- import { IVector2 } from '../../../Types/IVector2';
144
- import { IUnweightedGraph } from './IUnweightedGraph';
145
- export declare class UnweightedGraph<T extends IVector2> implements IUnweightedGraph<T> {
129
+ declare class UnweightedGraph<T extends IVector2> implements IUnweightedGraph<T> {
146
130
  edges: Map<T, T[]>;
147
131
  addEdgesForNode(node: T, neighbors: T[]): this;
148
132
  getNeighbors(node: T): T[];
149
133
  }
150
134
 
151
- import { IVector2 } from '../../../Types/IVector2';
152
- import { IUnweightedGraph } from './IUnweightedGraph';
153
- export declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
135
+ declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
154
136
  private static readonly CARDINAL_DIRS;
155
137
  private static readonly COMPASS_DIRS;
156
138
  walls: IVector2[];
@@ -165,3 +147,6 @@ export declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
165
147
  searchPath(start: IVector2, goal: IVector2): IVector2[];
166
148
  hasPath(start: IVector2, goal: IVector2): boolean;
167
149
  }
150
+
151
+ export { AStarPathfinder, AstarGridGraph, BreadthFirstPathfinder, PriorityQueue, UnweightedGraph, UnweightedGridGraph, Vector2Utils };
152
+ export type { IAstarGraph, IComparableVector2, IPriorityQueueNode, IUnweightedGraph, IVector2 };