OpenTTD Source: src/signal_type.h Source File

OpenTTD Source 12.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 {
17 SIG_ELECTRIC = 0,
18 SIG_SEMAPHORE = 1,
19 };
20
21
23 enum SignalType {
24 SIGTYPE_NORMAL = 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 };
36 template <> struct EnumPropsT<SignalType> : MakeEnumPropsT<SignalType, byte, SIGTYPE_NORMAL, SIGTYPE_END, SIGTYPE_END, 3> {};
37
38
44 enum SignalState {
45 SIGNAL_STATE_RED = 0,
46 SIGNAL_STATE_GREEN = 1,
47 };
48
49 #endif /* SIGNAL_TYPE_H */
SIGNAL_STATE_GREEN
@ SIGNAL_STATE_GREEN
The signal is green.
Definition: signal_type.h:46
SignalState
SignalState
These are states in which a signal can be.
Definition: signal_type.h:44
SignalType
SignalType
Type of signal, i.e.
Definition: signal_type.h:23
SIG_ELECTRIC
@ SIG_ELECTRIC
Light signal.
Definition: signal_type.h:17
SIGTYPE_PBS
@ SIGTYPE_PBS
normal pbs signal
Definition: signal_type.h:28
EnumPropsT
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
SIGTYPE_NORMAL
@ SIGTYPE_NORMAL
normal signal
Definition: signal_type.h:24
SIGNAL_STATE_RED
@ SIGNAL_STATE_RED
The signal is red.
Definition: signal_type.h:45
SIGTYPE_EXIT
@ SIGTYPE_EXIT
presignal block exit
Definition: signal_type.h:26
SIGTYPE_COMBO
@ SIGTYPE_COMBO
presignal inter-block
Definition: signal_type.h:27
SignalVariant
SignalVariant
Variant of the signal, i.e.
Definition: signal_type.h:16
SIGTYPE_PBS_ONEWAY
@ SIGTYPE_PBS_ONEWAY
no-entry signal
Definition: signal_type.h:29
SIGTYPE_ENTRY
@ SIGTYPE_ENTRY
presignal block entry
Definition: signal_type.h:25
enum_type.hpp
MakeEnumPropsT
Helper template class that makes basic properties of given enumeration type visible from outsize.
Definition: enum_type.hpp:62
SIG_SEMAPHORE
@ SIG_SEMAPHORE
Old-fashioned semaphore signal.
Definition: signal_type.h:18