#include <path.h>
Public Member Functions | |
void | clear () |
Totally clears the path. | |
bool | calculate () |
Tries to find the shortest path possible between the start point and the goal point. | |
u_int16 | nbr_moves () const |
Returns the number of moves between start and goal. | |
u_int16 | get_move (u_int16 nbr) const |
Returns the move to perform when at position nbr. | |
s_int8 | get_state (igzstream &file) |
Restore the path's state from an opened file. | |
s_int8 | put_state (ogzstream &file) const |
Saves the path's state into an opened file. | |
Public Attributes | |
landmap * | refmap |
Landmap where the pathfinding will occur. | |
u_int16 | submap |
Submap where the pathfinding will occur. | |
u_int16 | dir |
Direction to face once the goal is reached. | |
area_coord | start |
Start point. | |
area_coord | goal |
Goal point. | |
Classes | |
struct | area_coord |
(x, y) coordinates of a point on a submap. More... | |
struct | compare_squarecost |
This class calculates the shortest way from a begin point to a goal point on a landmap using the A* algorithm. It stores a list of directions that when followed lead from the start to the goal.
This class is particularly well designed for mapcharacters, who will often need to walk from one point to another.
Definition at line 48 of file path.h.
bool path::calculate | ( | ) |
u_int16 path::nbr_moves | ( | ) | const [inline] |
u_int16 path::get_move | ( | u_int16 | nbr | ) | const [inline] |
s_int8 path::get_state | ( | igzstream & | file | ) |
s_int8 path::put_state | ( | ogzstream & | file | ) | const |
u_int16 path::submap |