OpenTTD Source 20260721-master-g25ec12c62d
rail_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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef RAIL_TYPE_H
11#define RAIL_TYPE_H
12
13#include "core/enum_type.hpp"
14#include "core/label_type.hpp"
15
16using RailTypeLabel = Label<struct RailTypeLabelTag>;
17
18static const RailTypeLabel RAILTYPE_LABEL_RAIL{"RAIL"};
19static const RailTypeLabel RAILTYPE_LABEL_ELECTRIC{"ELRL"};
20static const RailTypeLabel RAILTYPE_LABEL_MONO{"MONO"};
21static const RailTypeLabel RAILTYPE_LABEL_MAGLEV{"MGLV"};
22
35
38
39static constexpr RailTypes INVALID_RAILTYPES{UINT64_MAX};
40
41#endif /* RAIL_TYPE_H */
Enum-as-bit-set wrapper.
Type (helpers) for enums.
A type for 4 character labels/tags/ids in files that should be read/shown as is.
EnumBitSet< RailType, uint64_t > RailTypes
Bitset of RailType elements.
Definition rail_type.h:37
RailType
Enumeration for all possible railtypes.
Definition rail_type.h:26
@ RAILTYPE_BEGIN
Used for iterations.
Definition rail_type.h:27
@ RAILTYPE_END
Used for iterations.
Definition rail_type.h:32
@ RAILTYPE_MONO
Monorail.
Definition rail_type.h:30
@ INVALID_RAILTYPE
Flag for invalid railtype.
Definition rail_type.h:33
@ RAILTYPE_ELECTRIC
Electric rails.
Definition rail_type.h:29
@ RAILTYPE_RAIL
Standard non-electric rails.
Definition rail_type.h:28
@ RAILTYPE_MAGLEV
Maglev.
Definition rail_type.h:31
A four character label/tag/id.