From a374caf51d9bce8eb26043f10d02db865d1a534e Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 14 Feb 2007 10:33:36 +0000 Subject: (svn r8730) -Codechange: more replacements of magic numbers by enums and removal of some (by now) redundant comments. --- src/road.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/road.h') diff --git a/src/road.h b/src/road.h index ef70733ec..c9adfa85a 100644 --- a/src/road.h +++ b/src/road.h @@ -28,4 +28,16 @@ static inline RoadBits DiagDirToRoadBits(DiagDirection d) return (RoadBits)(1U << (3 ^ d)); } +/** Checks whether the trackdir means that we are reversing */ +static inline bool IsReversingRoadTrackdir(Trackdir dir) +{ + return (dir & 0x07) >= 6; +} + +/** Checks whether the given trackdir is a straight road */ +static inline bool IsStraightRoadTrackdir(Trackdir dir) +{ + return (dir & 0x06) == 0; +} + #endif /* ROAD_H */ -- cgit v1.2.3-70-g09d2