pbs.cpp File Reference

PBS support routines. More...

#include "stdafx.h"
#include "functions.h"
#include "vehicle_func.h"
#include "pathfinder/follow_track.hpp"

Go to the source code of this file.

Data Structures

struct  FindTrainOnTrackInfo
 Helper struct for finding the best matching vehicle on a specific track. More...

Functions

TrackBits GetReservedTrackbits (TileIndex t)
 Get the reserved trackbits for any tile, regardless of type.
void SetRailStationPlatformReservation (TileIndex start, DiagDirection dir, bool b)
 Set the reservation for a complete station platform.
bool TryReserveRailTrack (TileIndex tile, Track t)
 Try to reserve a specific track on a tile.
void UnreserveRailTrack (TileIndex tile, Track t)
 Lift the reservation of a specific track on a tile.
static PBSTileInfo FollowReservation (Owner o, RailTypes rts, TileIndex tile, Trackdir trackdir, bool ignore_oneway=false)
 Follow a reservation starting from a specific tile to the end.
static VehicleFindTrainOnTrackEnum (Vehicle *v, void *data)
 Callback for Has/FindVehicleOnPos to find a train on a specific track.
PBSTileInfo FollowTrainReservation (const Train *v, Vehicle **train_on_res)
 Follow a train reservation to the last tile.
TrainGetTrainForReservation (TileIndex tile, Track track)
 Find the train which has reserved a specific path.
bool IsSafeWaitingPosition (const Train *v, TileIndex tile, Trackdir trackdir, bool include_line_end, bool forbid_90deg)
 Determine whether a certain track on a tile is a safe position to end a path.
bool IsWaitingPositionFree (const Train *v, TileIndex tile, Trackdir trackdir, bool forbid_90deg)
 Check if a safe position is free.

Detailed Description

PBS support routines.

Definition in file pbs.cpp.


Function Documentation

static Vehicle* FindTrainOnTrackEnum ( Vehicle v,
void *  data 
) [static]
static PBSTileInfo FollowReservation ( Owner  o,
RailTypes  rts,
TileIndex  tile,
Trackdir  trackdir,
bool  ignore_oneway = false 
) [static]
PBSTileInfo FollowTrainReservation ( const Train v,
Vehicle **  train_on_res 
)
TrackBits GetReservedTrackbits ( TileIndex  t  ) 
Train* GetTrainForReservation ( TileIndex  tile,
Track  track 
)
bool IsSafeWaitingPosition ( const Train v,
TileIndex  tile,
Trackdir  trackdir,
bool  include_line_end,
bool  forbid_90deg 
)
bool IsWaitingPositionFree ( const Train v,
TileIndex  tile,
Trackdir  trackdir,
bool  forbid_90deg 
)
void SetRailStationPlatformReservation ( TileIndex  start,
DiagDirection  dir,
bool  b 
)

Set the reservation for a complete station platform.

Precondition:
IsRailStationTile(start)
Parameters:
start starting tile of the platform
dir the direction in which to follow the platform
b the state the reservation should be set to

Definition at line 56 of file pbs.cpp.

References DiagDirToAxis(), GetRailStationAxis(), IsCompatibleTrainStationTile(), IsRailStationTile(), MarkTileDirtyByTile(), SetRailStationReservation(), TILE_ADD, and TileOffsByDiagDir().

Referenced by ClearPathReservation(), CmdBuildRailStation(), NPFSaveTargetData(), and RemoveFromRailBaseStation().

bool TryReserveRailTrack ( TileIndex  tile,
Track  t 
)
void UnreserveRailTrack ( TileIndex  tile,
Track  t 
)

Generated on Wed Mar 31 22:43:37 2010 for OpenTTD by  doxygen 1.6.1