OpenXcom
1.0
Open-source clone of the original X-Com
|
A class that holds references to the nodes to be examined in pathfinding. More...
#include <PathfindingOpenSet.h>
Public Member Functions | |
~PathfindingOpenSet () | |
Cleans up the set and frees allocated memory. More... | |
PathfindingNode * | pop () |
Gets the next node to check. More... | |
void | push (PathfindingNode *node) |
Adds a node to the set. More... | |
bool | empty () const |
Is the set empty? | |
A class that holds references to the nodes to be examined in pathfinding.
OpenXcom::PathfindingOpenSet::~PathfindingOpenSet | ( | ) |
Cleans up the set and frees allocated memory.
Cleans up all the entries still in set.
PathfindingNode * OpenXcom::PathfindingOpenSet::pop | ( | ) |
Gets the next node to check.
Gets the node with the least cost.
After this call, the node is no longer in the set. It is an error to call this when the set is empty.
void OpenXcom::PathfindingOpenSet::push | ( | PathfindingNode * | node | ) |
Adds a node to the set.
Places the node in the set.
If the node was already in the set, the previous entry is discarded. It is the caller's responsibility to never re-add a node with a worse cost.
node | A pointer to the node to add. |