This package implements the A* algorithm for optimal path finding
type Coordinate is record
X, Y : Integer;
end record;
type Coordinate_Array is array (Natural range <>) of Coordinate;
generic
type User_Data is private;
with function Heuristic_Cost
(Self : User_Data; Parent, From, To : Coordinate) return Integer;
with function Next_Point
(Self : User_Data;
From : Coordinate;
Nth : Positive) return Coordinate;
with function Heuristic_Dist
(Self : User_Data; P1, P2 : Coordinate) return Integer;
function Find_Path
(Self : User_Data;
From, To : Coordinate;
Parent : Coordinate) return Coordinate_Array
Return the optimal path from From to To. Parent is the point that came before From (in case the first segment is imposed for instance, to get away from the item)
generic
type User_Data is private;
function Manhattan_Next_Point
(Self : User_Data; From : Coordinate; Nth : Positive) return Coordinate
Points to the four possible neighboards in a horizontal and vertical grid.
No_Coordinate : constant Coordinate;
Not_Traversable : constant Integer;