Files
esengine/source/src/AI/Pathfinding/AStar/IAstarGraph.ts

22 lines
595 B
TypeScript
Raw Normal View History

2020-07-09 16:36:42 +08:00
/**
* graph的接口AstarPathfinder.search方法
*/
2020-06-09 19:45:09 +08:00
interface IAstarGraph<T> {
2020-07-09 16:36:42 +08:00
/**
* getNeighbors方法应该返回从传入的节点可以到达的任何相邻节点
* @param node
*/
2020-06-09 19:45:09 +08:00
getNeighbors(node: T): Array<T>;
2020-07-09 16:36:42 +08:00
/**
* from到to的成本
* @param from
* @param to
*/
2020-06-09 19:45:09 +08:00
cost(from: T, to: T): number;
2020-07-09 16:36:42 +08:00
/**
* node到to的启发式WeightedGridGraph了解常用的Manhatten方法
* @param node
* @param goal
*/
2020-06-09 19:45:09 +08:00
heuristic(node: T, goal: T);
}