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

#include <th_pathfind.h>

Inheritance diagram for idle_tile_finder:
abstract_pathfinder

Public Member Functions

 idle_tile_finder (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_idle_tile (const level_map *pMap, int iStartX, int iStartY, int iN, int parcelId)
 
- 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

path_nodebest_next_node
 
double best_distance
 
int start_x
 X coordinate of the start position.
 
int start_y
 Y coordinate of the start position.
 

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

◆ idle_tile_finder()

idle_tile_finder::idle_tile_finder ( pathfinder pf)
inlineexplicit

Member Function Documentation

◆ find_idle_tile()

bool idle_tile_finder::find_idle_tile ( const level_map pMap,
int  iStartX,
int  iStartY,
int  iN,
int  parcelId 
)
Parameters
pMapMap to search.
iStartXX coordinate of the start position.
iStartYY coordinate of the start position.
iNReturn the Nth idle tile. Used for queueing and randomizing idle tiles.
parcelIdId of the parcel with valid destinations, use 0 for any parcel.

◆ guess_distance()

int idle_tile_finder::guess_distance ( path_node pNode)
overridevirtual

Guess distance to the destination for pNode.

Parameters
pNodeNode to fill.

Implements abstract_pathfinder.

◆ try_node()

bool idle_tile_finder::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

◆ best_distance

double idle_tile_finder::best_distance

◆ best_next_node

path_node* idle_tile_finder::best_next_node

◆ start_x

int idle_tile_finder::start_x

X coordinate of the start position.

◆ start_y

int idle_tile_finder::start_y

Y coordinate of the start position.


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