OpenTTD
road_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef ROAD_TYPE_H
11 #define ROAD_TYPE_H
12 
13 #include "core/enum_type.hpp"
14 
15 typedef uint32 RoadTypeLabel;
16 
22 enum RoadType {
26  ROADTYPE_END = 63,
28 };
31 
36 enum RoadTypes : uint64 {
40  INVALID_ROADTYPES = UINT64_MAX,
41 };
43 
44 
50 enum RoadBits {
51  ROAD_NONE = 0U,
52  ROAD_NW = 1U,
53  ROAD_SW = 2U,
54  ROAD_SE = 4U,
55  ROAD_NE = 8U,
58 
63 
65 
67 };
69 template <> struct EnumPropsT<RoadBits> : MakeEnumPropsT<RoadBits, byte, ROAD_NONE, ROAD_END, ROAD_NONE, 4> {};
70 
71 #endif /* ROAD_TYPE_H */
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:62
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Invalid roadtypes.
Definition: road_type.h:40
RoadTypes
The different roadtypes we support, but then a bitmask of them.
Definition: road_type.h:36
Basic road type.
Definition: road_type.h:24
Full road along the x-axis (south-west + north-east)
Definition: road_type.h:56
Used for iterations.
Definition: road_type.h:26
South-west part.
Definition: road_type.h:53
flag for invalid roadtype
Definition: road_type.h:27
RoadType
The different roadtypes we support.
Definition: road_type.h:22
Type (helpers) for enums.
Trams.
Definition: road_type.h:39
Out-of-range roadbits, used for iterations.
Definition: road_type.h:66
Full 4-way crossing.
Definition: road_type.h:64
Road at the two southern edges.
Definition: road_type.h:61
Road at the two eastern edges.
Definition: road_type.h:60
Trams.
Definition: road_type.h:25
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
RoadBits
Enumeration for the road parts on a tile.
Definition: road_type.h:50
No road-part is build.
Definition: road_type.h:51
North-east part.
Definition: road_type.h:55
North-west part.
Definition: road_type.h:52
South-east part.
Definition: road_type.h:54
Used for iterations.
Definition: road_type.h:23
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
Full road along the y-axis (north-west + south-east)
Definition: road_type.h:57
No roadtypes.
Definition: road_type.h:37
Road at the two northern edges.
Definition: road_type.h:59
Road at the two western edges.
Definition: road_type.h:62