Constructor
new (p_map:MapHeader, p_timeOutDuration:Int = 10000)
Creates a new pathfinder class
Parameters:
p_map | The boolean coordinate map |
---|---|
p_timeOutDuration | The maximum time spent to find a path |
Methods
configure (p_map:MapHeader, p_timeOutDuration:Int = 10000):Void
Reconfigures an existing pathfinder class
Parameters:
p_map | The boolean coordinate map |
---|---|
p_timeOutDuration | The maximum time spent to find a path |
createPath (p_start:Coordinate, p_dest:Coordinate, ?p_heuristic:EHeuristic, p_isDiagonalEnabled:Bool = true, p_isMapDynamic:Bool = false):Array<Coordinate>
Calculates an A Star path between two nodes on a boolean map
Parameters:
p_start | The starting node |
---|---|
p_dest | The destination node |
p_heuristic | The method of A Star used |
p_isDiagonalEnabled | Set to false to ensure only up, left, down, right movements are allowed |
p_isMapDynamic | Set to true to force fresh lookups from MapHeader.isWalkable() for each node's isWalkable property (e.g. for a dynamically changing map) |
Returns:
An array of coordinates from start to destination, or null if no path was found within the time limit
getInfo ():String
A string to interpret the success of the latest path created
Returns:
Information string