#include <ai.h>
Public Methods | |
| cPath (Location startPos, Location finalPos, P_CHAR pc=NULL) | |
| void | exec () |
| Location | getNextPos () |
| Location | getFinalPos () |
| LOGICAL | targetReached () |
| LOGICAL | pathFound () |
Private Methods | |
| path_node * | create_node (Location pos, path_node *parentNode, UI32 cost) |
| UI08 | addReachableNodes (path_node *node) |
| Looks for every tile reachable walking by pos, and adds them to the open list. | |
| void | dropToClosedList (path_node *node) |
| Insert an element in the closed list, and removes it from the open list if present. | |
| void | addToOpenList (Location pos, path_node *parentNode, UI32 cost=10) |
| Adds an element to the open list. | |
| void | addToOpenList (path_node *node) |
| Adds an element to the open list. | |
| void | addToClosedList (path_node *node) |
| Adds an element to the closed list. | |
Private Attributes | |
| LOGICAL | m_pathFound |
| UI32 | m_loops |
| SERIAL | pc_serial |
| path_node * | currNode |
| path_node * | nextNode |
| queue< path_node > | nodes_vector |
| Location | m_startPos |
| Location | m_finalPos |
| NODE_LIST | open_list |
| NODE_LIST | closed_list |
| LOCATION_LIST | path_list |
|
||||||||||||||||
|
|
|
|
Looks for every tile reachable walking by pos, and adds them to the open list.
|
|
|
Adds an element to the closed list.
|
|
|
Adds an element to the open list.
|
|
||||||||||||||||
|
Adds an element to the open list.
|
|
||||||||||||||||
|
|
|
|
Insert an element in the closed list, and removes it from the open list if present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|