Files
OpenFrontIO/src/core/pathfinding/AStar.ts
T
2025-10-01 18:58:16 +02:00

27 lines
488 B
TypeScript

export interface AStar<NodeType> {
compute(): PathFindResultType;
reconstructPath(): NodeType[];
}
export enum PathFindResultType {
NextTile,
Pending,
Completed,
PathNotFound,
}
export type AStarResult<NodeType> =
| {
type: PathFindResultType.NextTile;
node: NodeType;
}
| {
type: PathFindResultType.Pending;
}
| {
type: PathFindResultType.Completed;
node: NodeType;
}
| {
type: PathFindResultType.PathNotFound;
};