#include <pathfinderastartile8dir.h>
Public Member Functions | |
| const PathResult | FindPath (const std::pair< long, long > &start, const std::pair< long, long > &goal, std::vector< std::pair< long, long > > &finalpath, MOVECOST &movecost, DESTCOST &destinationcost) |
| Finds a path from one x,y position to another. | |
| const PathResult | FindPath (const std::pair< long, long > &start, const std::pair< long, long > &goal, std::vector< std::pair< long, long > > &finalpath, MOVECOST &movecost, MOVEBLOCKED &moveblocked, DESTCOST &destinationcost) |
| Finds a path from one x,y position to another. | |
This is an A * path finder for tile based games where movement is possible in 8 directions surrounding each tile. Use the cached version of this class if state change costs mostly remain the same.
| MOVECOST | A functor implementing IMoveCost | |
| DESTCOST | A functor implementing IDestinationCost | |
| MOVEBLOCKED | A functor implementing IMoveBlocked | |
| COSTTYPE | The cost type of moving from state to state, typically a float or double |
| const PathResult Pathfinder::AStarTile8Dir< MOVECOST, DESTCOST, MOVEBLOCKED, COSTTYPE >::FindPath | ( | const std::pair< long, long > & | start, | |
| const std::pair< long, long > & | goal, | |||
| std::vector< std::pair< long, long > > & | finalpath, | |||
| MOVECOST & | movecost, | |||
| MOVEBLOCKED & | moveblocked, | |||
| DESTCOST & | destinationcost | |||
| ) | [inline] |
Finds a path from one x,y position to another.
This method finds a path from one state to another and takes into consideration that any of the surrounding tiles may not be reachable. This method will block until a path from the start to the goal is found or all reachable nodes have been checked without finding a path.
| start | The starting x,y position | |
| goal | The goal x,y position | |
| [out] | finalpath | A vector of x,y positions from the starting position to the goal position |
| movecost | A functor implementing IMoveCost | |
| moveblocked | A functor implementing IMoveBlocked | |
| destinationcost | A functor implementing IDestinationCost |
| const PathResult Pathfinder::AStarTile8Dir< MOVECOST, DESTCOST, MOVEBLOCKED, COSTTYPE >::FindPath | ( | const std::pair< long, long > & | start, | |
| const std::pair< long, long > & | goal, | |||
| std::vector< std::pair< long, long > > & | finalpath, | |||
| MOVECOST & | movecost, | |||
| DESTCOST & | destinationcost | |||
| ) | [inline] |
Finds a path from one x,y position to another.
This method finds a path from one state to another and assumes that all 8 surrounding tiles are always reachable. This method will block until a path from the start to the goal is found or all reachable nodes have been checked without finding a path.
| start | The starting x,y position | |
| goal | The goal x,y position | |
| [out] | finalpath | A vector of x,y positions from the starting position to the goal position |
| movecost | A functor implementing IMoveCost | |
| destinationcost | A functor implementing IDestinationCost |
1.5.7.1