mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 12:35:03 +00:00
27 lines
488 B
TypeScript
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;
|
|
};
|