CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
path_node Struct Reference

#include <th_pathfind.h>

Public Member Functions

int value () const
 Total cost of this node.
 

Public Attributes

const path_nodeprev
 Pointer to the previous node in the path to this cell.
 
int x
 X-position of this cell (constant)
 
int y
 Y-position of this cell (constant)
 
int distance
 Current shortest distance to this cell.
 
int guess
 Minimum distance from this cell to the goal.
 
size_t open_idx
 Index of this cell in the open heap.
 
bool visited
 True if the cell has already been visited (popped from the open heap)
 

Detailed Description

Node in the path finder routines.

Member Function Documentation

◆ value()

int path_node::value ( ) const
inline

Total cost of this node.

Returns
Total cost of the node, traveled distance and guess to the destination.

Member Data Documentation

◆ distance

int path_node::distance

Current shortest distance to this cell.

Defined as prev->distance + 1 (or 0 if prev == nullptr). Value is undefined if not part of a path.

◆ guess

int path_node::guess

Minimum distance from this cell to the goal.

Value is only dependent upon the cell position and the goal position, and is undefined if not part of a path.

◆ open_idx

size_t path_node::open_idx

Index of this cell in the open heap.

If the cell is not in the open heap, then this value is undefined.

◆ prev

const path_node* path_node::prev

Pointer to the previous node in the path to this cell.

Points to nullptr if this is the first cell in the path, or points to itself if it is not part of a path.

◆ visited

bool path_node::visited

True if the cell has already been visited (popped from the open heap)

◆ x

int path_node::x

X-position of this cell (constant)

◆ y

int path_node::y

Y-position of this cell (constant)


The documentation for this struct was generated from the following file: