(svn r13940) -Add [YAPP]: YAPF is now able to reserve the found path. (michi_cc)

This commit is contained in:
rubidium
2008-08-02 22:50:52 +00:00
parent 80c7dbcae7
commit 74b770a96a
6 changed files with 317 additions and 17 deletions

View File

@@ -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.
*