OpenTTD Source 20260206-master-g4d4e37dbf1
CYapfRoad Struct Reference
Inheritance diagram for CYapfRoad:
CYapfT< CYapfRoad_TypesT< CYapfRoad, CYapfDestinationTileRoadT > > CYapfBaseT< Types > CYapfCostRoadT< Types > CYapfSegmentCostCacheNoneT< Types > CYapfOriginTileT< Types > CYapfDestinationTileRoadT< Types > CYapfFollowRoadT< Types >

Additional Inherited Members

Public Types inherited from CYapfBaseT< Types >
typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::TrackFollower TrackFollower
typedef Types::NodeList NodeList
 our node list
typedef Types::VehicleType VehicleType
 the type of vehicle
typedef NodeList::Item Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
Public Types inherited from CYapfCostRoadT< Types >
typedef Types::Tpf Tpf
 pathfinder (derived from THIS class)
typedef Types::TrackFollower TrackFollower
 track follower helper
typedef Types::NodeList::Item Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
Public Types inherited from CYapfSegmentCostCacheNoneT< Types >
typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::NodeList::Item Node
 this will be our node type
Public Types inherited from CYapfOriginTileT< Types >
typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::NodeList::Item Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
Public Types inherited from CYapfDestinationTileRoadT< Types >
typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::TrackFollower TrackFollower
typedef Types::NodeList::Item Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
Public Types inherited from CYapfFollowRoadT< Types >
typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::TrackFollower TrackFollower
typedef Types::NodeList::Item Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
Public Member Functions inherited from CYapfBaseT< Types >
 CYapfBaseT ()
 default constructor
 ~CYapfBaseT ()
 default destructor
const YAPFSettingsPfGetSettings () const
 return current settings (can be custom - company based - but later)
bool FindPath (const VehicleType *v)
 Main pathfinder routine:
NodeGetBestNode ()
 If path was found return the best node that has reached the destination.
NodeCreateNewNode ()
 Calls NodeList::CreateNewNode() - allocates new node that can be filled and used as argument for AddStartupNode() or AddNewNode().
void AddStartupNode (Node &n)
 Add new node (created by CreateNewNode and filled with data) into open list.
void AddMultipleNodes (Node *parent, const TrackFollower &tf)
 add multiple nodes - direct children of the given node
void AddNewNode (Node &n, const TrackFollower &follower)
 AddNewNode() - called by Tderived::PfFollowNode() for each child node.
const VehicleTypeGetVehicle () const
void DumpBase (DumpTarget &dmp) const
Public Member Functions inherited from CYapfCostRoadT< Types >
void SetMaxCost (int max_cost)
bool PfCalcCost (Node &n, const TrackFollower *)
 Called by YAPF to calculate the cost from the origin to the given node.
Public Member Functions inherited from CYapfSegmentCostCacheNoneT< Types >
bool PfNodeCacheFetch (Node &)
 Called by YAPF to attach cached or local segment cost data to the given node.
Public Member Functions inherited from CYapfOriginTileT< Types >
void SetOrigin (TileIndex tile, TrackdirBits trackdirs)
 Set origin tile / trackdir mask.
Public Member Functions inherited from CYapfDestinationTileRoadT< Types >
void SetDestination (const RoadVehicle *v)
const StationGetDestinationStation () const
bool PfDetectDestination (Node &n)
 Called by YAPF to detect if node ends in the desired destination.
bool PfDetectDestinationTile (TileIndex tile, Trackdir trackdir)
bool PfCalcEstimate (Node &n)
 Called by YAPF to calculate cost estimate.
Public Member Functions inherited from CYapfFollowRoadT< Types >
void PfFollowNode (Node &old_node)
 Called by YAPF to move from the given node to the next tile.
char TransportTypeChar () const
 return debug report character to identify the transportation type
Trackdir ChooseRoadTrack (const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found, RoadVehPathCache &path_cache)
uint DistanceToTile (const RoadVehicle *v, TileIndex dst_tile)
bool SetOriginFromVehiclePos (const RoadVehicle *v)
 Return true if the valid origin (tile/trackdir) was set from the current vehicle position.
FindDepotData FindNearestDepot (const RoadVehicle *v, TileIndex tile, Trackdir td, int max_distance)
 Find the best depot for a road vehicle.
Static Public Member Functions inherited from CYapfFollowRoadT< Types >
static Trackdir stChooseRoadTrack (const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found, RoadVehPathCache &path_cache)
static FindDepotData stFindNearestDepot (const RoadVehicle *v, TileIndex tile, Trackdir td, int max_distance)
Data Fields inherited from CYapfBaseT< Types >
NodeList nodes
 node list multi-container
int num_steps = 0
 this is there for debugging purposes (hope it doesn't hurt)
Protected Member Functions inherited from CYapfBaseT< Types >
TpfYapf ()
 to access inherited path finder
Protected Member Functions inherited from CYapfCostRoadT< Types >
TpfYapf ()
 to access inherited path finder
int SlopeCost (TileIndex tile, TileIndex next_tile, Trackdir)
int OneTileCost (TileIndex tile, Trackdir trackdir)
 return one tile cost
Protected Member Functions inherited from CYapfOriginTileT< Types >
TpfYapf ()
 to access inherited path finder
Protected Member Functions inherited from CYapfDestinationTileRoadT< Types >
TpfYapf ()
 to access inherited path finder
Protected Member Functions inherited from CYapfFollowRoadT< Types >
TpfYapf ()
 to access inherited path finder
Protected Attributes inherited from CYapfBaseT< Types >
Nodebest_dest_node = nullptr
 pointer to the destination node found at last round
Nodebest_intermediate_node = nullptr
 here should be node closest to the destination if path not found
const YAPFSettingssettings
 current settings (_settings_game.yapf)
int max_search_nodes
 maximum number of nodes we are allowed to visit before we give up
const VehicleTypevehicle = nullptr
 vehicle that we are trying to drive
int stats_cost_calcs = 0
 stats - how many node's costs were calculated
int stats_cache_hits = 0
 stats - how many node's costs were reused from cache
Protected Attributes inherited from CYapfCostRoadT< Types >
int max_cost
Protected Attributes inherited from CYapfDestinationTileRoadT< Types >
TileIndex dest_tile
TrackdirBits dest_trackdirs
StationID dest_station
StationType station_type
bool non_artic

Detailed Description

Definition at line 504 of file yapf_road.cpp.


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