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

#include <th_pathfind.h>

Inheritance diagram for basic_pathfinder:
abstract_pathfinder

Public Member Functions

 basic_pathfinder (pathfinder *pf)
 
int guess_distance (path_node *pNode) override
 Guess distance to the destination for pNode.
 
bool try_node (path_node *pNode, map_tile_flags flags, path_node *pNeighbour, travel_direction direction) override
 Try the pNeighbour node.
 
bool find_path (const level_map *pMap, int iStartX, int iStartY, int iEndX, int iEndY)
 
- Public Member Functions inherited from abstract_pathfinder
 abstract_pathfinder (pathfinder *pf)
 
virtual ~abstract_pathfinder ()=default
 
path_nodeinit (const level_map *pMap, int iStartX, int iStarty)
 Initialize the path finder.
 
bool search_neighbours (path_node *pNode, map_tile_flags flags, int iWidth)
 Expand the pNode to its neighbours.
 
void record_neighbour_if_passable (path_node *pNode, map_tile_flags neighbour_flags, bool passable, path_node *pNeighbour)
 

Public Attributes

int destination_x
 X coordinate of the destination of the path.
 
int destination_y
 Y coordinate of the destination of the path.
 

Additional Inherited Members

- Protected Attributes inherited from abstract_pathfinder
pathfinderparent
 Path finder parent object, containing shared data.
 
const level_mapmap
 Map being searched.
 

Constructor & Destructor Documentation

◆ basic_pathfinder()

basic_pathfinder::basic_pathfinder ( pathfinder pf)
inlineexplicit

Member Function Documentation

◆ find_path()

bool basic_pathfinder::find_path ( const level_map pMap,
int  iStartX,
int  iStartY,
int  iEndX,
int  iEndY 
)

◆ guess_distance()

int basic_pathfinder::guess_distance ( path_node pNode)
overridevirtual

Guess distance to the destination for pNode.

Parameters
pNodeNode to fill.

Implements abstract_pathfinder.

◆ try_node()

bool basic_pathfinder::try_node ( path_node pNode,
map_tile_flags  flags,
path_node pNeighbour,
travel_direction  direction 
)
overridevirtual

Try the pNeighbour node.

Parameters
pNodeSource node.
flagsFlags of the node.
pNeighbourNeighbour of pNode to try.
directionDirection of travel.
Returns
Whether the search is done.

Implements abstract_pathfinder.

Member Data Documentation

◆ destination_x

int basic_pathfinder::destination_x

X coordinate of the destination of the path.

◆ destination_y

int basic_pathfinder::destination_y

Y coordinate of the destination of the path.


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