(svn r11237) -Codechange: reduce code duplication between GetRailFoundation() and CheckRailSlope(). Patch by frosch.

This commit is contained in:
rubidium
2007-10-09 21:11:23 +00:00
parent 038c98bee3
commit f22c5ba602
4 changed files with 112 additions and 52 deletions

View File

@@ -120,6 +120,19 @@ static inline TrackBits AxisToTrackBits(Axis a)
return TrackToTrackBits(AxisToTrack(a));
}
/**
* Returns a single horizontal/vertical trackbit, that is in a specific tile corner.
*
* @param corner The corner of a tile.
* @return The TrackBits of the track in the corner.
*/
static inline TrackBits CornerToTrackBits(Corner corner)
{
extern const TrackBits _corner_to_trackbits[];
assert(IsValidCorner(corner));
return _corner_to_trackbits[corner];
}
/**
* Enumeration for tracks and directions.