(svn r20049) -Feature: [NewGRF] Add a railtype flag to disallow level crossings per railtype.
This commit is contained in:
18
src/rail.h
18
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)
|
||||
|
||||
@@ -258,6 +260,16 @@ static inline bool HasPowerOnRail(RailType enginetype, RailType tiletype)
|
||||
return HasBit(GetRailTypeInfo(enginetype)->powered_railtypes, 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.
|
||||
|
Reference in New Issue
Block a user