@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.
- package/{bin/modules/astar.js → dist/pathfinding.cjs} +18 -27
- package/dist/pathfinding.cjs.map +1 -0
- package/{bin → dist}/pathfinding.d.ts +24 -41
- package/dist/pathfinding.js +556 -0
- package/dist/pathfinding.js.map +1 -0
- package/{bin/modules/breadth-first.js → dist/pathfinding.mjs} +11 -28
- package/dist/pathfinding.mjs.map +1 -0
- package/package.json +23 -21
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/source.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.vscode/tasks.json +0 -13
- package/.wing/settings.json +0 -3
- package/bin/README.md +0 -245
- package/bin/modules/astar.min.js +0 -1
- package/bin/modules/breadth-first.min.js +0 -1
- package/bin/package.json +0 -54
- package/bin/pathfinding.js +0 -559
- package/bin/pathfinding.min.js +0 -1
- package/gulpfile.js +0 -137
- package/lib/wxgame.d.ts +0 -3945
- package/src/AI/Pathfinding/AStar/AStarPathfinder.ts +0 -244
- package/src/AI/Pathfinding/AStar/AstarGridGraph.ts +0 -183
- package/src/AI/Pathfinding/AStar/IAstarGraph.ts +0 -30
- package/src/AI/Pathfinding/BreadthFirst/BreadthFirstPathfinder.ts +0 -109
- package/src/AI/Pathfinding/BreadthFirst/IUnweightedGraph.ts +0 -14
- package/src/AI/Pathfinding/BreadthFirst/UnweightedGraph.ts +0 -29
- package/src/AI/Pathfinding/BreadthFirst/UnweightedGridGraph.ts +0 -81
- package/src/Types/IVector2.ts +0 -102
- package/src/Utils/PriorityQueue.ts +0 -121
- package/src/index.ts +0 -49
- package/tsconfig.json +0 -34
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @esengine/pathfinding v1.0.2
|
|
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 = (
|
|
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; }
|
|
@@ -310,10 +306,7 @@ var AStarPathfinder = (function () {
|
|
|
310
306
|
AStarPathfinder._tempPath = [];
|
|
311
307
|
return AStarPathfinder;
|
|
312
308
|
}());
|
|
313
|
-
export { AStarPathfinder };
|
|
314
309
|
|
|
315
|
-
import { Vector2Utils } from '../../../Types/IVector2';
|
|
316
|
-
import { AStarPathfinder } from './AStarPathfinder';
|
|
317
310
|
var AstarGridGraph = (function () {
|
|
318
311
|
function AstarGridGraph(width, height) {
|
|
319
312
|
this.dirs = [
|
|
@@ -423,11 +416,7 @@ var AstarGridGraph = (function () {
|
|
|
423
416
|
};
|
|
424
417
|
return AstarGridGraph;
|
|
425
418
|
}());
|
|
426
|
-
export { AstarGridGraph };
|
|
427
419
|
|
|
428
|
-
export {};
|
|
429
|
-
|
|
430
|
-
import { Vector2Utils } from '../../../Types/IVector2';
|
|
431
420
|
var BreadthFirstPathfinder = (function () {
|
|
432
421
|
function BreadthFirstPathfinder() {
|
|
433
422
|
}
|
|
@@ -485,9 +474,6 @@ var BreadthFirstPathfinder = (function () {
|
|
|
485
474
|
};
|
|
486
475
|
return BreadthFirstPathfinder;
|
|
487
476
|
}());
|
|
488
|
-
export { BreadthFirstPathfinder };
|
|
489
|
-
|
|
490
|
-
export {};
|
|
491
477
|
|
|
492
478
|
var UnweightedGraph = (function () {
|
|
493
479
|
function UnweightedGraph() {
|
|
@@ -502,10 +488,7 @@ var UnweightedGraph = (function () {
|
|
|
502
488
|
};
|
|
503
489
|
return UnweightedGraph;
|
|
504
490
|
}());
|
|
505
|
-
export { UnweightedGraph };
|
|
506
491
|
|
|
507
|
-
import { Vector2Utils } from '../../../Types/IVector2';
|
|
508
|
-
import { BreadthFirstPathfinder } from './BreadthFirstPathfinder';
|
|
509
492
|
var UnweightedGridGraph = (function () {
|
|
510
493
|
function UnweightedGridGraph(width, height, allowDiagonalSearch) {
|
|
511
494
|
if (allowDiagonalSearch === void 0) { allowDiagonalSearch = false; }
|
|
@@ -556,4 +539,12 @@ var UnweightedGridGraph = (function () {
|
|
|
556
539
|
];
|
|
557
540
|
return UnweightedGridGraph;
|
|
558
541
|
}());
|
|
559
|
-
|
|
542
|
+
|
|
543
|
+
exports.AStarPathfinder = AStarPathfinder;
|
|
544
|
+
exports.AstarGridGraph = AstarGridGraph;
|
|
545
|
+
exports.BreadthFirstPathfinder = BreadthFirstPathfinder;
|
|
546
|
+
exports.PriorityQueue = PriorityQueue;
|
|
547
|
+
exports.UnweightedGraph = UnweightedGraph;
|
|
548
|
+
exports.UnweightedGridGraph = UnweightedGridGraph;
|
|
549
|
+
exports.Vector2Utils = Vector2Utils;
|
|
550
|
+
//# 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 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.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adthFirst/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.2
|
|
3
|
+
* TypeScript definitions
|
|
4
|
+
*/
|
|
5
|
+
interface IVector2 {
|
|
12
6
|
x: number;
|
|
13
7
|
y: number;
|
|
14
8
|
}
|
|
15
|
-
|
|
9
|
+
interface IComparableVector2 extends IVector2 {
|
|
16
10
|
equals?(other: IVector2): boolean;
|
|
17
11
|
}
|
|
18
|
-
|
|
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
|
-
|
|
26
|
+
interface IPriorityQueueNode {
|
|
33
27
|
priority: number;
|
|
34
28
|
}
|
|
35
|
-
|
|
29
|
+
declare class PriorityQueue<T extends IPriorityQueueNode> {
|
|
36
30
|
private _heap;
|
|
37
31
|
private _size;
|
|
38
32
|
get size(): number;
|
|
@@ -46,9 +40,12 @@ export declare class PriorityQueue<T extends IPriorityQueueNode> {
|
|
|
46
40
|
private _swap;
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
}
|
|
48
|
+
|
|
52
49
|
declare class AStarNode implements IPriorityQueueNode {
|
|
53
50
|
node: IVector2;
|
|
54
51
|
priority: number;
|
|
@@ -61,7 +58,7 @@ declare class AStarNode implements IPriorityQueueNode {
|
|
|
61
58
|
updateNode(node: IVector2, gCost?: number, hCost?: number, parent?: AStarNode | null): void;
|
|
62
59
|
reset(): void;
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
declare class AStarPathfinder {
|
|
65
62
|
private static _nodePool;
|
|
66
63
|
private static _tempPath;
|
|
67
64
|
private static _getNode;
|
|
@@ -79,11 +76,8 @@ export declare class AStarPathfinder {
|
|
|
79
76
|
maxPoolSize: number;
|
|
80
77
|
};
|
|
81
78
|
}
|
|
82
|
-
export {};
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
import { IAstarGraph } from './IAstarGraph';
|
|
86
|
-
export declare class AstarGridGraph implements IAstarGraph<IVector2> {
|
|
80
|
+
declare class AstarGridGraph implements IAstarGraph<IVector2> {
|
|
87
81
|
dirs: IVector2[];
|
|
88
82
|
walls: IVector2[];
|
|
89
83
|
weightedNodes: IVector2[];
|
|
@@ -120,37 +114,23 @@ export declare class AstarGridGraph implements IAstarGraph<IVector2> {
|
|
|
120
114
|
};
|
|
121
115
|
}
|
|
122
116
|
|
|
123
|
-
|
|
124
|
-
export interface IAstarGraph<T extends IVector2> {
|
|
117
|
+
interface IUnweightedGraph<T extends IVector2> {
|
|
125
118
|
getNeighbors(node: T): T[];
|
|
126
|
-
cost(from: T, to: T): number;
|
|
127
|
-
heuristic(node: T, goal: T): number;
|
|
128
119
|
}
|
|
129
120
|
|
|
130
|
-
|
|
131
|
-
import { IUnweightedGraph } from './IUnweightedGraph';
|
|
132
|
-
export declare class BreadthFirstPathfinder {
|
|
121
|
+
declare class BreadthFirstPathfinder {
|
|
133
122
|
static search<T extends IVector2>(graph: IUnweightedGraph<T>, start: T, goal: T, cameFrom?: Map<number, T>): boolean;
|
|
134
123
|
static searchPath<T extends IVector2>(graph: IUnweightedGraph<T>, start: T, goal: T): T[];
|
|
135
124
|
static reconstructPath<T extends IVector2>(cameFrom: Map<number, T>, start: T, goal: T): T[];
|
|
136
125
|
}
|
|
137
126
|
|
|
138
|
-
|
|
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> {
|
|
127
|
+
declare class UnweightedGraph<T extends IVector2> implements IUnweightedGraph<T> {
|
|
146
128
|
edges: Map<T, T[]>;
|
|
147
129
|
addEdgesForNode(node: T, neighbors: T[]): this;
|
|
148
130
|
getNeighbors(node: T): T[];
|
|
149
131
|
}
|
|
150
132
|
|
|
151
|
-
|
|
152
|
-
import { IUnweightedGraph } from './IUnweightedGraph';
|
|
153
|
-
export declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
|
|
133
|
+
declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
|
|
154
134
|
private static readonly CARDINAL_DIRS;
|
|
155
135
|
private static readonly COMPASS_DIRS;
|
|
156
136
|
walls: IVector2[];
|
|
@@ -165,3 +145,6 @@ export declare class UnweightedGridGraph implements IUnweightedGraph<IVector2> {
|
|
|
165
145
|
searchPath(start: IVector2, goal: IVector2): IVector2[];
|
|
166
146
|
hasPath(start: IVector2, goal: IVector2): boolean;
|
|
167
147
|
}
|
|
148
|
+
|
|
149
|
+
export { AStarPathfinder, AstarGridGraph, BreadthFirstPathfinder, PriorityQueue, UnweightedGraph, UnweightedGridGraph, Vector2Utils };
|
|
150
|
+
export type { IAstarGraph, IComparableVector2, IPriorityQueueNode, IUnweightedGraph, IVector2 };
|