diff options
Diffstat (limited to 'src/rail.h')
-rw-r--r-- | src/rail.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rail.h b/src/rail.h index 01af4f369..7a05eda73 100644 --- a/src/rail.h +++ b/src/rail.h @@ -22,10 +22,12 @@ /** Railtype flags. */ enum RailTypeFlags { - RTF_CATENARY = 0, ///< Bit number for drawing a catenary. + RTF_CATENARY = 0, ///< Bit number for drawing a catenary. + RTF_NO_LEVEL_CROSSING = 1, ///< Bit number for disallowing level crossings. - RTFB_NONE = 0, ///< All flags cleared. - RTFB_CATENARY = 1 << RTF_CATENARY, ///< Value for drawing a catenary. + RTFB_NONE = 0, ///< All flags cleared. + RTFB_CATENARY = 1 << RTF_CATENARY, ///< Value for drawing a catenary. + RTFB_NO_LEVEL_CROSSING = 1 << RTF_NO_LEVEL_CROSSING, ///< Value for disallowing level crossings. }; DECLARE_ENUM_AS_BIT_SET(RailTypeFlags) @@ -259,6 +261,16 @@ static inline bool HasPowerOnRail(RailType enginetype, RailType tiletype) } /** + * Test if a RailType disallows build of level crossings. + * @param rt The RailType to check. + * @return Whether level crossings are not allowed. + */ +static inline bool RailNoLevelCrossings(RailType rt) +{ + return HasBit(GetRailTypeInfo(rt)->flags, RTF_NO_LEVEL_CROSSING); +} + +/** * Returns the cost of building the specified railtype. * @param railtype The railtype being built. * @return The cost multiplier. |