OpenTTD Source: src/signal_type.h Source File

OpenTTD Source 15.0-beta1

signal_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 SIGNAL_TYPE_H
11#define SIGNAL_TYPE_H
12
13#include "core/enum_type.hpp"
14
16 enum SignalVariant : uint8_t {
17 SIG_ELECTRIC = 0,
18 SIG_SEMAPHORE = 1,
19};
20
21
23 enum SignalType : uint8_t {
24 SIGTYPE_BLOCK = 0,
25 SIGTYPE_ENTRY = 1,
26 SIGTYPE_EXIT = 2,
27 SIGTYPE_COMBO = 3,
28 SIGTYPE_PBS = 4,
29 SIGTYPE_PBS_ONEWAY = 5,
30
31 SIGTYPE_END,
32 SIGTYPE_LAST = SIGTYPE_PBS_ONEWAY,
33 SIGTYPE_LAST_NOPBS = SIGTYPE_COMBO,
34};
35 DECLARE_ENUM_AS_ADDABLE(SignalType)
36
37
42enum SignalState {
43 SIGNAL_STATE_RED = 0,
44 SIGNAL_STATE_GREEN = 1,
45};
46
47#endif /* SIGNAL_TYPE_H */
enum_type.hpp
Type (helpers) for enums.
DECLARE_ENUM_AS_ADDABLE
#define DECLARE_ENUM_AS_ADDABLE(EnumType)
Operator that allows this enumeration to be added to any other enumeration.
Definition enum_type.hpp:45
SignalType
SignalType
Type of signal, i.e.
Definition signal_type.h:23
SIGTYPE_PBS_ONEWAY
@ SIGTYPE_PBS_ONEWAY
no-entry signal
Definition signal_type.h:29
SIGTYPE_PBS
@ SIGTYPE_PBS
normal pbs signal
Definition signal_type.h:28
SIGTYPE_ENTRY
@ SIGTYPE_ENTRY
presignal block entry
Definition signal_type.h:25
SIGTYPE_COMBO
@ SIGTYPE_COMBO
presignal inter-block
Definition signal_type.h:27
SIGTYPE_EXIT
@ SIGTYPE_EXIT
presignal block exit
Definition signal_type.h:26
SIGTYPE_BLOCK
@ SIGTYPE_BLOCK
block signal
Definition signal_type.h:24
SignalState
SignalState
These are states in which a signal can be.
Definition signal_type.h:42
SIGNAL_STATE_RED
@ SIGNAL_STATE_RED
The signal is red.
Definition signal_type.h:43
SIGNAL_STATE_GREEN
@ SIGNAL_STATE_GREEN
The signal is green.
Definition signal_type.h:44
SignalVariant
SignalVariant
Variant of the signal, i.e.
Definition signal_type.h:16
SIG_SEMAPHORE
@ SIG_SEMAPHORE
Old-fashioned semaphore signal.
Definition signal_type.h:18
SIG_ELECTRIC
@ SIG_ELECTRIC
Light signal.
Definition signal_type.h:17