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

#include <th_pathfind.h>

Inheritance diagram for object_visitor:
abstract_pathfinder

Public Member Functions

 object_visitor (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 visit_objects (const level_map *pMap, int iStartX, int iStartY, object_type eTHOB, int iMaxDistance, lua_State *L, int iVisitFunction, bool anyObjectType)
 
- 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

lua_StateL
 
int visit_function_index
 
int max_distance
 
bool target_any_object_type
 
object_type target
 

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

◆ object_visitor()

object_visitor::object_visitor ( pathfinder pf)
inlineexplicit

Member Function Documentation

◆ guess_distance()

int object_visitor::guess_distance ( path_node pNode)
overridevirtual

Guess distance to the destination for pNode.

Parameters
pNodeNode to fill.

Implements abstract_pathfinder.

◆ try_node()

bool object_visitor::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.

◆ visit_objects()

bool object_visitor::visit_objects ( const level_map pMap,
int  iStartX,
int  iStartY,
object_type  eTHOB,
int  iMaxDistance,
lua_State L,
int  iVisitFunction,
bool  anyObjectType 
)

Member Data Documentation

◆ L

lua_State* object_visitor::L

◆ max_distance

int object_visitor::max_distance

◆ target

object_type object_visitor::target

◆ target_any_object_type

bool object_visitor::target_any_object_type

◆ visit_function_index

int object_visitor::visit_function_index

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