OpenTTD Source  20241108-master-g80f628063a
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_t RoadTypeLabel;
16 
17 static const RoadTypeLabel ROADTYPE_LABEL_ROAD = 'ROAD';
18 static const RoadTypeLabel ROADTYPE_LABEL_TRAM = 'ELRL';
19 
25 enum RoadType : uint8_t {
29  ROADTYPE_END = 63,
31 };
33 
34 
38 enum RoadTypes : uint64_t {
42  INVALID_ROADTYPES = UINT64_MAX,
43 };
45 
46 
52 enum RoadBits : uint8_t {
53  ROAD_NONE = 0U,
54  ROAD_NW = 1U,
55  ROAD_SW = 2U,
56  ROAD_SE = 4U,
57  ROAD_NE = 8U,
60 
65 
67 
69 };
71 
72 
73 enum DisallowedRoadDirections : uint8_t {
79 };
81 
82 #endif /* ROAD_TYPE_H */
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Type (helpers) for enums.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:18
RoadBits
Enumeration for the road parts on a tile.
Definition: road_type.h:52
@ ROAD_SW
South-west part.
Definition: road_type.h:55
@ ROAD_ALL
Full 4-way crossing.
Definition: road_type.h:66
@ ROAD_NONE
No road-part is build.
Definition: road_type.h:53
@ ROAD_E
Road at the two eastern edges.
Definition: road_type.h:62
@ ROAD_NE
North-east part.
Definition: road_type.h:57
@ ROAD_N
Road at the two northern edges.
Definition: road_type.h:61
@ ROAD_SE
South-east part.
Definition: road_type.h:56
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
Definition: road_type.h:59
@ ROAD_S
Road at the two southern edges.
Definition: road_type.h:63
@ ROAD_W
Road at the two western edges.
Definition: road_type.h:64
@ ROAD_NW
North-west part.
Definition: road_type.h:54
@ ROAD_X
Full road along the x-axis (south-west + north-east)
Definition: road_type.h:58
@ ROAD_END
Out-of-range roadbits, used for iterations.
Definition: road_type.h:68
RoadTypes
The different roadtypes we support, but then a bitmask of them.
Definition: road_type.h:38
@ ROADTYPES_TRAM
Trams.
Definition: road_type.h:41
@ INVALID_ROADTYPES
Invalid roadtypes.
Definition: road_type.h:42
@ ROADTYPES_ROAD
Road.
Definition: road_type.h:40
@ ROADTYPES_NONE
No roadtypes.
Definition: road_type.h:39
RoadType
The different roadtypes we support.
Definition: road_type.h:25
@ INVALID_ROADTYPE
flag for invalid roadtype
Definition: road_type.h:30
@ ROADTYPE_TRAM
Trams.
Definition: road_type.h:28
@ ROADTYPE_ROAD
Basic road type.
Definition: road_type.h:27
@ ROADTYPE_END
Used for iterations.
Definition: road_type.h:29
@ ROADTYPE_BEGIN
Used for iterations.
Definition: road_type.h:26
DisallowedRoadDirections
Which directions are disallowed ?
Definition: road_type.h:73
@ DRD_NORTHBOUND
All northbound traffic is disallowed.
Definition: road_type.h:76
@ DRD_END
Sentinel.
Definition: road_type.h:78
@ DRD_BOTH
All directions are disallowed.
Definition: road_type.h:77
@ DRD_NONE
None of the directions are disallowed.
Definition: road_type.h:74
@ DRD_SOUTHBOUND
All southbound traffic is disallowed.
Definition: road_type.h:75