OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::PathfindingOpenSet Class Reference

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...
 
PathfindingNodepop ()
 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?
 

Detailed Description

A class that holds references to the nodes to be examined in pathfinding.

Constructor & Destructor Documentation

OpenXcom::PathfindingOpenSet::~PathfindingOpenSet ( )

Cleans up the set and frees allocated memory.

Cleans up all the entries still in set.

Member Function Documentation

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.

Returns
A pointer to the node which had the least cost.
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.

Parameters
nodeA pointer to the node to add.

The documentation for this class was generated from the following files: