summaryrefslogtreecommitdiff
path: root/src/pbs.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-02 22:50:52 +0000
committerrubidium <rubidium@openttd.org>2008-08-02 22:50:52 +0000
commitabc46b1e866b2d079aac7db946213715302c6dfb (patch)
treedfeb569a2bbf1ab6fa93e0ffb7508a68a9644f9c /src/pbs.h
parentc91c12addeed18baf93a0031d68814a09974bff2 (diff)
downloadopenttd-abc46b1e866b2d079aac7db946213715302c6dfb.tar.xz
(svn r13940) -Add [YAPP]: YAPF is now able to reserve the found path. (michi_cc)
Diffstat (limited to 'src/pbs.h')
-rw-r--r--src/pbs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pbs.h b/src/pbs.h
index 4103f1ebf..d4b87b8e6 100644
--- a/src/pbs.h
+++ b/src/pbs.h
@@ -8,6 +8,7 @@
#include "tile_type.h"
#include "direction_type.h"
#include "track_type.h"
+#include "vehicle_type.h"
TrackBits GetReservedTrackbits(TileIndex t);
@@ -16,6 +17,20 @@ void SetRailwayStationPlatformReservation(TileIndex start, DiagDirection dir, bo
bool TryReserveRailTrack(TileIndex tile, Track t);
void UnreserveRailTrack(TileIndex tile, Track t);
+/** This struct contains information about the end of a reserved path. */
+struct PBSTileInfo {
+ TileIndex tile; ///< Tile the path ends, INVALID_TILE if no valid path was found.
+ Trackdir trackdir; ///< The reserved trackdir on the tile.
+ bool okay; ///< True if tile is a safe wairing position, false otherwise.
+
+ PBSTileInfo() : tile(INVALID_TILE), trackdir(INVALID_TRACKDIR), okay(false) {}
+ PBSTileInfo(TileIndex _t, Trackdir _td, bool _okay) : tile(_t), trackdir(_td), okay(_okay) {}
+};
+
+PBSTileInfo FollowTrainReservation(const Vehicle *v);
+bool IsSafeWaitingPosition(const Vehicle *v, TileIndex tile, Trackdir trackdir, bool include_line_end, bool forbid_90deg = false);
+bool IsWaitingPositionFree(const Vehicle *v, TileIndex tile, Trackdir trackdir, bool forbid_90deg = false);
+
/**
* Check whether some of tracks is reserved on a tile.
*