YAPF destination provider for route links. More...
Public Member Functions | |
FORCEINLINE int | GetMaxCost () const |
Get the maximum allowed node cost. | |
void | SetDestination (const TileArea &dest, uint max_cost) |
Set destination. | |
FORCEINLINE int | DeliveryCost (Station *st) |
Cost for delivering the cargo to the final destination tile. | |
FORCEINLINE bool | PfDetectDestination (StationID st_id) const |
Called by YAPF to detect if the station reaches the destination. | |
FORCEINLINE bool | PfDetectDestination (const Node &n) const |
Called by YAPF to detect if the node reaches the destination. | |
FORCEINLINE bool | PfCalcEstimate (Node &n) |
Called by YAPF to calculate the estimated cost to the destination. | |
Private Types | |
typedef Types::Tpf | Tpf |
The pathfinder class (derived from THIS class). | |
typedef Types::NodeList::Titem | Node |
This will be our node type. | |
Private Member Functions | |
FORCEINLINE Tpf & | Yapf () |
To access inherited path finder. | |
Private Attributes | |
TileArea | m_dest |
int | m_max_cost |
Maximum node cost. |
YAPF destination provider for route links.
Definition at line 260 of file yapf_cargo.cpp.
FORCEINLINE int CYapfDestinationRouteLinkT< Types >::DeliveryCost | ( | Station * | st | ) | [inline] |
Cost for delivering the cargo to the final destination tile.
Definition at line 285 of file yapf_cargo.cpp.
References StationRect::PtInExtendedRect(), BaseStation::rect, TileArea::tile, TileX(), TileY(), and CYapfDestinationRouteLinkT< Types >::Yapf().
FORCEINLINE int CYapfDestinationRouteLinkT< Types >::GetMaxCost | ( | ) | const [inline] |
Get the maximum allowed node cost.
Definition at line 272 of file yapf_cargo.cpp.
References CYapfDestinationRouteLinkT< Types >::m_max_cost.
FORCEINLINE bool CYapfDestinationRouteLinkT< Types >::PfCalcEstimate | ( | Node & | n | ) | [inline] |
Called by YAPF to calculate the estimated cost to the destination.
Definition at line 313 of file yapf_cargo.cpp.
References DistanceManhattan(), SpecializedStation< Station, false >::Get(), CYapfDestinationRouteLinkT< Types >::PfDetectDestination(), BaseStation::xy, and CYapfDestinationRouteLinkT< Types >::Yapf().
FORCEINLINE bool CYapfDestinationRouteLinkT< Types >::PfDetectDestination | ( | const Node & | n | ) | const [inline] |
Called by YAPF to detect if the node reaches the destination.
Definition at line 307 of file yapf_cargo.cpp.
FORCEINLINE bool CYapfDestinationRouteLinkT< Types >::PfDetectDestination | ( | StationID | st_id | ) | const [inline] |
Called by YAPF to detect if the station reaches the destination.
Definition at line 300 of file yapf_cargo.cpp.
References StationRect::AreaInExtendedRect(), SpecializedStation< Station, false >::Get(), Station::GetCatchmentRadius(), and BaseStation::rect.
Referenced by CYapfDestinationRouteLinkT< Types >::PfCalcEstimate().
void CYapfDestinationRouteLinkT< Types >::SetDestination | ( | const TileArea & | dest, | |
uint | max_cost | |||
) | [inline] |
Set destination.
Definition at line 278 of file yapf_cargo.cpp.
References CYapfDestinationRouteLinkT< Types >::m_max_cost.
FORCEINLINE Tpf& CYapfDestinationRouteLinkT< Types >::Yapf | ( | ) | [inline, private] |
To access inherited path finder.
Definition at line 268 of file yapf_cargo.cpp.
Referenced by CYapfDestinationRouteLinkT< Types >::DeliveryCost(), and CYapfDestinationRouteLinkT< Types >::PfCalcEstimate().