OpenTTD Source  12.0-beta2
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 */
ROAD_N
@ ROAD_N
Road at the two northern edges.
Definition: road_type.h:59
INVALID_ROADTYPE
@ INVALID_ROADTYPE
flag for invalid roadtype
Definition: road_type.h:27
ROAD_SW
@ ROAD_SW
South-west part.
Definition: road_type.h:53
ROAD_END
@ ROAD_END
Out-of-range roadbits, used for iterations.
Definition: road_type.h:66
ROAD_X
@ ROAD_X
Full road along the x-axis (south-west + north-east)
Definition: road_type.h:56
ROADTYPE_END
@ ROADTYPE_END
Used for iterations.
Definition: road_type.h:26
INVALID_ROADTYPES
@ INVALID_ROADTYPES
Invalid roadtypes.
Definition: road_type.h:40
ROADTYPE_ROAD
@ ROADTYPE_ROAD
Basic road type.
Definition: road_type.h:24
RoadBits
RoadBits
Enumeration for the road parts on a tile.
Definition: road_type.h:50
ROAD_NONE
@ ROAD_NONE
No road-part is build.
Definition: road_type.h:51
DECLARE_POSTFIX_INCREMENT
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
EnumPropsT
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
ROAD_E
@ ROAD_E
Road at the two eastern edges.
Definition: road_type.h:60
ROADTYPE_TRAM
@ ROADTYPE_TRAM
Trams.
Definition: road_type.h:25
ROADTYPES_TRAM
@ ROADTYPES_TRAM
Trams.
Definition: road_type.h:39
RoadTypes
RoadTypes
The different roadtypes we support, but then a bitmask of them.
Definition: road_type.h:36
ROAD_NE
@ ROAD_NE
North-east part.
Definition: road_type.h:55
ROAD_SE
@ ROAD_SE
South-east part.
Definition: road_type.h:54
ROAD_S
@ ROAD_S
Road at the two southern edges.
Definition: road_type.h:61
ROAD_ALL
@ ROAD_ALL
Full 4-way crossing.
Definition: road_type.h:64
ROADTYPE_BEGIN
@ ROADTYPE_BEGIN
Used for iterations.
Definition: road_type.h:23
RoadType
RoadType
The different roadtypes we support.
Definition: road_type.h:22
ROAD_NW
@ ROAD_NW
North-west part.
Definition: road_type.h:52
ROAD_Y
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
Definition: road_type.h:57
ROADTYPES_ROAD
@ ROADTYPES_ROAD
Road.
Definition: road_type.h:38
enum_type.hpp
MakeEnumPropsT
Helper template class that makes basic properties of given enumeration type visible from outsize.
Definition: enum_type.hpp:62
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:29
ROAD_W
@ ROAD_W
Road at the two western edges.
Definition: road_type.h:62
ROADTYPES_NONE
@ ROADTYPES_NONE
No roadtypes.
Definition: road_type.h:37