新增breadthfirst与dijkstra寻路算法

This commit is contained in:
yhh
2020-06-10 12:23:19 +08:00
parent 538677575d
commit 5f7c13c8cd
16 changed files with 929 additions and 29 deletions

View File

@@ -37,7 +37,7 @@ class AstarGridGraph implements IAstarGraph<Point> {
* @param node
*/
public isNodePassable(node: Point): boolean {
return !this.walls.contains(node);
return !this.walls.firstOrDefault(wall => JSON.stringify(wall) == JSON.stringify(node));
}
public search(start: Point, goal: Point){