OpenTTD Source 20260208-master-g43af8e94d0
YapfRiverBuilder Class Reference
Inheritance diagram for YapfRiverBuilder:
CYapfBaseT< RiverBuilderTypes > CYapfSegmentCostCacheNoneT< RiverBuilderTypes >

Public Types

using Node = RiverBuilderTypes::NodeList::Item
using Key = Node::Key
Public Types inherited from CYapfBaseT< RiverBuilderTypes >
typedef RiverBuilderTypes::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef RiverBuilderTypes::TrackFollower TrackFollower
typedef RiverBuilderTypes::NodeList NodeList
 our node list
typedef RiverBuilderTypes::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 CYapfSegmentCostCacheNoneT< RiverBuilderTypes >
typedef RiverBuilderTypes::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef RiverBuilderTypes::NodeList::Item Node
 this will be our node type

Public Member Functions

 YapfRiverBuilder (TileIndex start_tile, TileIndex end_tile)
bool PfDetectDestination (Node &n) const
bool PfCalcCost (Node &n, const RiverBuilderFollower *)
bool PfCalcEstimate (Node &n)
void PfFollowNode (Node &old_node)
char TransportTypeChar () const
Public Member Functions inherited from CYapfBaseT< RiverBuilderTypes >
 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 CYapfSegmentCostCacheNoneT< RiverBuilderTypes >
bool PfNodeCacheFetch (Node &)
 Called by YAPF to attach cached or local segment cost data to the given node.

Static Public Member Functions

static void BuildRiver (TileIndex start_tile, TileIndex end_tile, TileIndex spring_tile, bool main_river)

Protected Member Functions

YapfRiverBuilderYapf ()
Protected Member Functions inherited from CYapfBaseT< RiverBuilderTypes >
TpfYapf ()
 to access inherited path finder

Protected Attributes

TileIndex end_tile
 End tile of the river.
Protected Attributes inherited from CYapfBaseT< RiverBuilderTypes >
Nodebest_dest_node
 pointer to the destination node found at last round
Nodebest_intermediate_node
 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
 vehicle that we are trying to drive
int stats_cost_calcs
 stats - how many node's costs were calculated
int stats_cache_hits
 stats - how many node's costs were reused from cache

Additional Inherited Members

Data Fields inherited from CYapfBaseT< RiverBuilderTypes >
NodeList nodes
 node list multi-container
int num_steps
 this is there for debugging purposes (hope it doesn't hurt)

Detailed Description

Definition at line 41 of file yapf_river_builder.cpp.

Member Typedef Documentation

◆ Key

using YapfRiverBuilder::Key = Node::Key

Definition at line 47 of file yapf_river_builder.cpp.

◆ Node

using YapfRiverBuilder::Node = RiverBuilderTypes::NodeList::Item

Definition at line 46 of file yapf_river_builder.cpp.

Constructor & Destructor Documentation

◆ YapfRiverBuilder()

YapfRiverBuilder::YapfRiverBuilder ( TileIndex start_tile,
TileIndex end_tile )
inline

Definition at line 58 of file yapf_river_builder.cpp.

Member Function Documentation

◆ BuildRiver()

void YapfRiverBuilder::BuildRiver ( TileIndex start_tile,
TileIndex end_tile,
TileIndex spring_tile,
bool main_river )
inlinestatic

Definition at line 102 of file yapf_river_builder.cpp.

◆ PfCalcCost()

bool YapfRiverBuilder::PfCalcCost ( Node & n,
const RiverBuilderFollower *  )
inline

Definition at line 72 of file yapf_river_builder.cpp.

◆ PfCalcEstimate()

bool YapfRiverBuilder::PfCalcEstimate ( Node & n)
inline

Definition at line 78 of file yapf_river_builder.cpp.

◆ PfDetectDestination()

bool YapfRiverBuilder::PfDetectDestination ( Node & n) const
inline

Definition at line 67 of file yapf_river_builder.cpp.

◆ PfFollowNode()

void YapfRiverBuilder::PfFollowNode ( Node & old_node)
inline

Definition at line 85 of file yapf_river_builder.cpp.

◆ TransportTypeChar()

char YapfRiverBuilder::TransportTypeChar ( ) const
inline

Definition at line 97 of file yapf_river_builder.cpp.

◆ Yapf()

YapfRiverBuilder & YapfRiverBuilder::Yapf ( )
inlineprotected

Definition at line 52 of file yapf_river_builder.cpp.

Field Documentation

◆ end_tile

TileIndex YapfRiverBuilder::end_tile
protected

End tile of the river.

Definition at line 50 of file yapf_river_builder.cpp.


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