Fix #10490: Allow ships to exit depots if another is not moving at the exit point...
[openttd-github.git] / src / signal_type.h
blob294790fae70a8cabcb37960767cef5ef9262165a
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 */
8 /** @file signal_type.h Types and classes related to signals. */
10 #ifndef SIGNAL_TYPE_H
11 #define SIGNAL_TYPE_H
13 #include "core/enum_type.hpp"
15 /** Variant of the signal, i.e. how does the signal look? */
16 enum SignalVariant : byte {
17 SIG_ELECTRIC = 0, ///< Light signal
18 SIG_SEMAPHORE = 1, ///< Old-fashioned semaphore signal
22 /** Type of signal, i.e. how does the signal behave? */
23 enum SignalType : byte {
24 SIGTYPE_BLOCK = 0, ///< block signal
25 SIGTYPE_ENTRY = 1, ///< presignal block entry
26 SIGTYPE_EXIT = 2, ///< presignal block exit
27 SIGTYPE_COMBO = 3, ///< presignal inter-block
28 SIGTYPE_PBS = 4, ///< normal pbs signal
29 SIGTYPE_PBS_ONEWAY = 5, ///< no-entry signal
31 SIGTYPE_END,
32 SIGTYPE_LAST = SIGTYPE_PBS_ONEWAY,
33 SIGTYPE_LAST_NOPBS = SIGTYPE_COMBO,
35 DECLARE_ENUM_AS_ADDABLE(SignalType)
37 /**
38 * These are states in which a signal can be. Currently these are only two, so
39 * simple boolean logic will do. But do try to compare to this enum instead of
40 * normal boolean evaluation, since that will make future additions easier.
42 enum SignalState {
43 SIGNAL_STATE_RED = 0, ///< The signal is red
44 SIGNAL_STATE_GREEN = 1, ///< The signal is green
47 #endif /* SIGNAL_TYPE_H */