diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-15 00:03:01 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 46bd2f1cedde365218a3f1a52116fe169587af89 (patch) | |
tree | 633af4662d44346fc74abe4646b22c01df42e78a /src/road_type.h | |
parent | 55170ae703dd2f55ae5c2151aa97dd12da1e917e (diff) | |
download | openttd-46bd2f1cedde365218a3f1a52116fe169587af89.tar.xz |
Codechange: Un-bitstuff remaining transport infrastructure commands.
Diffstat (limited to 'src/road_type.h')
-rw-r--r-- | src/road_type.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/road_type.h b/src/road_type.h index 969b141ba..a792db7ba 100644 --- a/src/road_type.h +++ b/src/road_type.h @@ -19,7 +19,7 @@ typedef uint32 RoadTypeLabel; * * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported. */ -enum RoadType { +enum RoadType : byte { ROADTYPE_BEGIN = 0, ///< Used for iterations ROADTYPE_ROAD = 0, ///< Basic road type ROADTYPE_TRAM = 1, ///< Trams @@ -47,7 +47,7 @@ DECLARE_ENUM_AS_BIT_SET(RoadTypes) * This enumeration defines the possible road parts which * can be build on a tile. */ -enum RoadBits { +enum RoadBits : byte { ROAD_NONE = 0U, ///< No road-part is build ROAD_NW = 1U, ///< North-west part ROAD_SW = 2U, ///< South-west part @@ -68,4 +68,16 @@ enum RoadBits { DECLARE_ENUM_AS_BIT_SET(RoadBits) template <> struct EnumPropsT<RoadBits> : MakeEnumPropsT<RoadBits, byte, ROAD_NONE, ROAD_END, ROAD_NONE, 4> {}; +/** Which directions are disallowed ? */ +enum DisallowedRoadDirections : byte { + DRD_NONE, ///< None of the directions are disallowed + DRD_SOUTHBOUND, ///< All southbound traffic is disallowed + DRD_NORTHBOUND, ///< All northbound traffic is disallowed + DRD_BOTH, ///< All directions are disallowed + DRD_END, ///< Sentinel +}; +DECLARE_ENUM_AS_BIT_SET(DisallowedRoadDirections) +/** Helper information for extract tool. */ +template <> struct EnumPropsT<DisallowedRoadDirections> : MakeEnumPropsT<DisallowedRoadDirections, byte, DRD_NONE, DRD_END, DRD_END, 2> {}; + #endif /* ROAD_TYPE_H */ |