OpenTTD Source 20250613-master-ga1786fa1f4
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 <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef RAIL_TYPE_H
11#define RAIL_TYPE_H
12
13#include "core/enum_type.hpp"
14
15typedef uint32_t RailTypeLabel;
16
17static const RailTypeLabel RAILTYPE_LABEL_RAIL = 'RAIL';
18static const RailTypeLabel RAILTYPE_LABEL_ELECTRIC = 'ELRL';
19static const RailTypeLabel RAILTYPE_LABEL_MONO = 'MONO';
20static const RailTypeLabel RAILTYPE_LABEL_MAGLEV = 'MGLV';
21
34
37
38using RailTypes = EnumBitSet<RailType, uint64_t>;
39
40static constexpr RailTypes INVALID_RAILTYPES{UINT64_MAX};
41
42#endif /* RAIL_TYPE_H */
Type (helpers) for enums.
#define DECLARE_INCREMENT_DECREMENT_OPERATORS(enum_type)
For some enums it is useful to have pre/post increment/decrement operators.
Definition enum_type.hpp:63
RailType
Enumeration for all possible railtypes.
Definition rail_type.h:25
@ RAILTYPE_BEGIN
Used for iterations.
Definition rail_type.h:26
@ RAILTYPE_END
Used for iterations.
Definition rail_type.h:31
@ RAILTYPE_MONO
Monorail.
Definition rail_type.h:29
@ INVALID_RAILTYPE
Flag for invalid railtype.
Definition rail_type.h:32
@ RAILTYPE_ELECTRIC
Electric rails.
Definition rail_type.h:28
@ RAILTYPE_RAIL
Standard non-electric rails.
Definition rail_type.h:27
@ RAILTYPE_MAGLEV
Maglev.
Definition rail_type.h:30