CYapfCostRoadT< Types > Class Template Reference

Inheritance diagram for CYapfCostRoadT< Types >:
CYapfT< CYapfRoad_TypesT< CYapfRoad1, CRoadNodeListTrackDir, CYapfDestinationTileRoadT > > CYapfT< CYapfRoad_TypesT< CYapfRoad2, CRoadNodeListExitDir, CYapfDestinationTileRoadT > > CYapfT< CYapfRoad_TypesT< CYapfRoadAnyDepot1, CRoadNodeListTrackDir, CYapfDestinationAnyDepotRoadT > > CYapfT< CYapfRoad_TypesT< CYapfRoadAnyDepot2, CRoadNodeListExitDir, CYapfDestinationAnyDepotRoadT > > CYapfRoad1 CYapfRoad2 CYapfRoadAnyDepot1 CYapfRoadAnyDepot2

Public Types

typedef Types::Tpf Tpf
 pathfinder (derived from THIS class)
typedef Types::TrackFollower TrackFollower
 track follower helper
typedef Types::NodeList::Titem Node
 this will be our node type
typedef Node::Key Key
 key to hash tables

Public Member Functions

FORCEINLINE bool PfCalcCost (Node &n, const TrackFollower *tf)
 Called by YAPF to calculate the cost from the origin to the given node.

Protected Member Functions

TpfYapf ()
 to access inherited path finder
int SlopeCost (TileIndex tile, TileIndex next_tile, Trackdir trackdir)
FORCEINLINE int OneTileCost (TileIndex tile, Trackdir trackdir)
 return one tile cost

Detailed Description

template<class Types>
class CYapfCostRoadT< Types >

Definition at line 19 of file yapf_road.cpp.


Member Function Documentation

template<class Types >
FORCEINLINE bool CYapfCostRoadT< Types >::PfCalcCost ( Node n,
const TrackFollower tf 
) [inline]

Called by YAPF to calculate the cost from the origin to the given node.

Calculates only the cost of given node, adds it to the parent node cost and stores the result into Node::m_cost member

Definition at line 100 of file yapf_road.cpp.

References DiagDirToDiagTrackdir(), FindFirstBit2x64(), KillFirstBit(), Vehicle::max_speed, ReverseDiagDir(), TRACKDIR_BIT_NONE, CYapfCostRoadT< Types >::Yapf(), and YAPF_TILE_LENGTH.


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

Generated on Sat Apr 17 23:25:24 2010 for OpenTTD by  doxygen 1.6.1