OpenXcom
1.0
Open-source clone of the original X-Com
|
A class that holds pathfinding info for a certain node on the map. More...
#include <PathfindingNode.h>
Public Member Functions | |
PathfindingNode (Position pos) | |
Creates a new PathfindingNode class. More... | |
~PathfindingNode () | |
Cleans up the PathfindingNode. More... | |
const Position & | getPosition () const |
Gets the node position. More... | |
void | reset () |
Resets the node. | |
bool | isChecked () const |
Is checked? More... | |
void | setChecked () |
Marks the node as checked. | |
int | getTUCost (bool missile) const |
Gets the TU cost. More... | |
PathfindingNode * | getPrevNode () const |
Gets the previous node. More... | |
int | getPrevDir () const |
Gets the previous walking direction. More... | |
bool | inOpenSet () const |
Is this node already in a PathfindingOpenSet? | |
int | getTUGuess () const |
Gets the approximate cost to reach the target position. | |
void | connect (int tuCost, PathfindingNode *prevNode, int prevDir, const Position &target) |
Connects to previous node along the path. More... | |
void | connect (int tuCost, PathfindingNode *prevNode, int prevDir) |
Connects to previous node along a visit. More... | |
A class that holds pathfinding info for a certain node on the map.
OpenXcom::PathfindingNode::PathfindingNode | ( | Position | pos | ) |
OpenXcom::PathfindingNode::~PathfindingNode | ( | ) |
Cleans up the PathfindingNode.
Deletes the PathfindingNode.
void OpenXcom::PathfindingNode::connect | ( | int | tuCost, |
PathfindingNode * | prevNode, | ||
int | prevDir, | ||
const Position & | target | ||
) |
Connects to previous node along the path.
Connects the node.
This will connect the node to the previous node along the path to target and update the pathfinding information.
tuCost | The total cost of the path so far. |
prevNode | The previous node along the path. |
prevDir | The direction FROM the previous node. |
target | The target position (used to update our guess cost). |
void OpenXcom::PathfindingNode::connect | ( | int | tuCost, |
PathfindingNode * | prevNode, | ||
int | prevDir | ||
) |
Connects to previous node along a visit.
Connects the node.
This will connect the node to the previous node along the path.
tuCost | The total cost of the path so far. |
prevNode | The previous node along the path. |
prevDir | The direction FROM the previous node. |
const Position & OpenXcom::PathfindingNode::getPosition | ( | ) | const |
Gets the node position.
int OpenXcom::PathfindingNode::getPrevDir | ( | ) | const |
Gets the previous walking direction.
Gets the previous walking direction for how we got on this node.
PathfindingNode * OpenXcom::PathfindingNode::getPrevNode | ( | ) | const |
Gets the previous node.
int OpenXcom::PathfindingNode::getTUCost | ( | bool | missile | ) | const |
Gets the TU cost.
missile | Is this a missile? |
bool OpenXcom::PathfindingNode::isChecked | ( | ) | const |
Is checked?
Gets the checked status of this node.