CYapfReserveTrack< Types > Class Template Reference

Inheritance diagram for CYapfReserveTrack< Types >:
CYapfFollowAnySafeTileRailT< Types > CYapfFollowRailT< Types > CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail1, CFollowTrackFreeRail, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail2, CFollowTrackFreeRailNo90, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfT< CYapfRail_TypesT< CYapfRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfAnyDepotRail1 CYapfAnyDepotRail2 CYapfAnySafeTileRail1 CYapfAnySafeTileRail2 CYapfRail1 CYapfRail2

Public Types

typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::TrackFollower TrackFollower
typedef Types::NodeList::Titem Node
 this will be our node type

Public Member Functions

void SetReservationTarget (Node *node, TileIndex tile, Trackdir td)
 Set the target to where the reservation should be extended.
void FindSafePositionOnNode (Node *node)
 Check the node for a possible reservation target.
bool TryReservePath (PBSTileInfo *target)
 Try to reserve the path till the reservation target.

Protected Member Functions

FORCEINLINE TpfYapf ()
 to access inherited pathfinder

Private Member Functions

bool FindSafePositionProc (TileIndex tile, Trackdir td)
bool ReserveRailStationPlatform (TileIndex &tile, DiagDirection dir)
 Reserve a railway platform.
bool ReserveSingleTrack (TileIndex tile, Trackdir td)
 Try to reserve a single track/platform.
bool UnreserveSingleTrack (TileIndex tile, Trackdir td)
 Unreserve a single track/platform.

Private Attributes

TileIndex m_res_dest
 The reservation target tile.
Trackdir m_res_dest_td
 The reservation target trackdir.
Nodem_res_node
 The reservation target node.
TileIndex m_res_fail_tile
 The tile where the reservation failed.
Trackdir m_res_fail_td
 The trackdir where the reservation failed.

Detailed Description

template<class Types>
class CYapfReserveTrack< Types >

Definition at line 41 of file yapf_rail.cpp.


Member Function Documentation

template<class Types >
void CYapfReserveTrack< Types >::FindSafePositionOnNode ( Node node  )  [inline]

Check the node for a possible reservation target.

Definition at line 135 of file yapf_rail.cpp.

References CYapfReserveTrack< Types >::m_res_node, and CYapfReserveTrack< Types >::Yapf().

template<class Types >
bool CYapfReserveTrack< Types >::ReserveRailStationPlatform ( TileIndex tile,
DiagDirection  dir 
) [inline, private]

Reserve a railway platform.

Tile contains the failed tile on abort.

Definition at line 73 of file yapf_rail.cpp.

References HasStationReservation(), IsCompatibleTrainStationTile(), MarkTileDirtyByTile(), SetRailStationReservation(), TILE_ADD, and TileOffsByDiagDir().

Referenced by CYapfReserveTrack< Types >::ReserveSingleTrack().

template<class Types >
bool CYapfReserveTrack< Types >::ReserveSingleTrack ( TileIndex  tile,
Trackdir  td 
) [inline, private]
template<class Types >
void CYapfReserveTrack< Types >::SetReservationTarget ( Node node,
TileIndex  tile,
Trackdir  td 
) [inline]

Set the target to where the reservation should be extended.

Definition at line 127 of file yapf_rail.cpp.

References CYapfReserveTrack< Types >::m_res_dest, CYapfReserveTrack< Types >::m_res_dest_td, and CYapfReserveTrack< Types >::m_res_node.

template<class Types >
bool CYapfReserveTrack< Types >::TryReservePath ( PBSTileInfo target  )  [inline]
template<class Types >
bool CYapfReserveTrack< Types >::UnreserveSingleTrack ( TileIndex  tile,
Trackdir  td 
) [inline, private]

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

Generated on Fri May 27 04:20:38 2011 for OpenTTD by  doxygen 1.6.1