PathFinder Class Reference
[AI]
Generic A* implementation.
More...
Classes | |
| struct | PathFinderNode |
Public Member Functions | |
| PathFinder () | |
| bool | FindPath (const PathFinderAgent *agent, const PathFinderCell *start, const PathFinderCell *end, Array< const PathFinderCell * > &path, int iterationSafetyLimit=80000) |
Detailed Description
Generic A* implementation.This class implements a generic pathfinder using the A* algorithm. It allows the caller to specify methods for calculating and estimating costs of movement, as well as enumerating neighbour cells. This means it can find paths within any type of connected cells, be it geographical paths or problem solving paths.
For flexibility, agents and cells are defined as void pointers, ad it is up to the calling code to map these pointers to its appropriate internal datastructures.
Definition at line 36 of file PathFinder.h.
Constructor & Destructor Documentation
| PathFinder::PathFinder | ( | ) |
Definition at line 21 of file PathFinder.cpp.
Member Function Documentation
| bool PathFinder::FindPath | ( | const PathFinderAgent * | agent, | |
| const PathFinderCell * | start, | |||
| const PathFinderCell * | end, | |||
| Array< const PathFinderCell * > & | path, | |||
| int | iterationSafetyLimit = 80000 | |||
| ) |
Attempts to find a path from one cell to another
- Returns:
- True if a path was found, False if not
- Parameters:
-
agent The agent that is to travel along the path start The start cell of the path end The desired goal cell of the path path Array that will hold the resulting path, if one was found iterationSafetyLimit Maximum number of iterations before aborting pathfinding. This is a safety limit, to avoid having the program hang for too long. Specify 0 for no limit.
Definition at line 77 of file PathFinder.cpp.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
