![]() |
Dragonfly 4.22
A text-based game engine
|
Public Member Functions | |
| PathFind (Object *p_o, Vector start, Vector end) | |
| SearchResult | cycleOnce () |
| Path | getPath () const |
| void | setObject (Object *new_p_o) |
| Object * | getObject () const |
| int | getNumPlies () const |
| void | setTargetObject (Object *p_target_o) |
| Object * | getTargetObject () |
Private Attributes | |
| Object * | m_p_o |
| Object * | m_p_target_o |
| coord_struct | m_start |
| coord_struct | m_end |
| struct node_struct ** | m_node |
| std::vector< coord_struct > | m_open_set |
| std::vector< coord_struct > | m_closed_set |
| int | m_num_plies |
| bool | m_is_path |
Constructor needs Object doing pathfinding, start and end positions.
| SearchResult df::PathFind::cycleOnce | ( | ) |
Go through one search cycle.
Returns indication if found path {found, not found, incomplete}.
| int df::PathFind::getNumPlies | ( | ) | const |
Return number of plies.
| Object * df::PathFind::getObject | ( | ) | const |
Return object seeking path.
| Path df::PathFind::getPath | ( | ) | const |
Return path.
| Object * df::PathFind::getTargetObject | ( | ) |
Get target object.
Pathfinding stops when target object discovered.
| void df::PathFind::setObject | ( | Object * | new_p_o | ) |
Set object seeking path.
| void df::PathFind::setTargetObject | ( | Object * | p_target_o | ) |
Set target object.
Pathfinding stops when target object discovered.
|
private |
Set of nodes visited.
|
private |
End target position.
|
private |
True if path is complete.
|
private |
All nodes in 2d graph/grid.
|
private |
Number of plies cycled.
|
private |
Set of nodes not yet visited.
|
private |
Start position.