OpenTTD Source
20241120-master-g6d3adc6169
|
Public Types | |
typedef Types::Tpf | Tpf |
the pathfinder class (derived from THIS class) | |
typedef Types::TrackFollower | TrackFollower |
typedef Types::NodeList::Item | 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, TileIndex origin) |
Try to reserve the path till the reservation target. | |
Protected Member Functions | |
Tpf & | Yapf () |
to access inherited pathfinder | |
Private Member Functions | |
bool | FindSafePositionProc (TileIndex tile, Trackdir td) |
bool | ReserveRailStationPlatform (TileIndex &tile, DiagDirection dir) |
Reserve a railway platform. More... | |
bool | ReserveSingleTrack (TileIndex tile, Trackdir td) |
Try to reserve a single track/platform. | |
bool | UnreserveSingleTrack (TileIndex tile, Trackdir td) |
Unreserve a single track/platform. More... | |
Private Attributes | |
TileIndex | res_dest_tile |
The reservation target tile. | |
Trackdir | res_dest_td |
The reservation target trackdir. | |
Node * | res_dest_node |
The reservation target node. | |
TileIndex | res_fail_tile |
The tile where the reservation failed. | |
Trackdir | res_fail_td |
The trackdir where the reservation failed. | |
TileIndex | origin_tile |
Tile our reservation will originate from. | |
std::vector< std::pair< TileIndex, Trackdir > > | signals_set_to_red |
List of signals turned red during a path reservation. | |
Definition at line 36 of file yapf_rail.cpp.
|
inlineprivate |
Reserve a railway platform.
Tile contains the failed tile on abort.
Definition at line 71 of file yapf_rail.cpp.
References HasStationReservation(), IsCompatibleTrainStationTile(), MarkTileDirtyByTile(), SetRailStationReservation(), SRT_PATH_RESERVATION, TileAdd(), TileOffsByDiagDir(), and TriggerStationRandomisation().
Referenced by CYapfReserveTrack< Types >::ReserveSingleTrack().
|
inlineprivate |
Unreserve a single track/platform.
Stops when the previous failer is reached.
Definition at line 118 of file yapf_rail.cpp.
References IsCompatibleTrainStationTile(), IsRailStationTile(), CYapfReserveTrack< Types >::res_fail_td, ReverseTrackdir(), SetRailStationReservation(), TileAdd(), TileOffsByDiagDir(), TrackdirToExitdir(), TrackdirToTrack(), and UnreserveRailTrack().