(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)

This commit is contained in:
rubidium
2008-08-02 22:47:20 +00:00
parent ea570c8160
commit ec7cc49825
7 changed files with 254 additions and 8 deletions

View File

@@ -197,6 +197,21 @@ static inline bool IsValidTrackdir(Trackdir trackdir)
* TrackdirBits, Direction and DiagDirections.
*/
/**
* Find the opposite track to a given track.
*
* TRACK_LOWER -> TRACK_UPPER and vice versa, likewise for left/right.
* TRACK_X is mapped to TRACK_Y and reversed.
*
* @param t the track to convert
* @return the opposite track
*/
static inline Track TrackToOppositeTrack(Track t)
{
assert(t != INVALID_TRACK);
return (Track)(t ^ 1);
}
/**
* Maps a trackdir to the reverse trackdir.
*