CYapfDestinationRouteLinkT< Types > Class Template Reference

YAPF destination provider for route links. More...

Inheritance diagram for CYapfDestinationRouteLinkT< Types >:
CYapfT< CYapfRouteLink_TypesT< CYapfRouteLink > > CYapfRouteLink

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 TpfYapf ()
 To access inherited path finder.

Private Attributes

TileArea m_dest
int m_max_cost
 Maximum node cost.

Detailed Description

template<class Types>
class CYapfDestinationRouteLinkT< Types >

YAPF destination provider for route links.

Definition at line 260 of file yapf_cargo.cpp.


Member Function Documentation

template<class Types >
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().

template<class Types >
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.

template<class Types >
FORCEINLINE bool CYapfDestinationRouteLinkT< Types >::PfCalcEstimate ( Node n  )  [inline]
template<class Types >
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.

template<class Types >
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().

template<class Types >
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.

template<class Types >
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().


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

Generated on Fri Jun 3 05:19:50 2011 for OpenTTD by  doxygen 1.6.1