2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-03-28 04:23:49 +01:00
|
|
|
/** @file signal_type.h Types and classes related to signals. */
|
|
|
|
|
|
|
|
#ifndef SIGNAL_TYPE_H
|
|
|
|
#define SIGNAL_TYPE_H
|
|
|
|
|
2010-08-27 00:01:16 +02:00
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
2008-03-28 04:23:49 +01:00
|
|
|
/** Variant of the signal, i.e. how does the signal look? */
|
2024-03-16 23:59:32 +01:00
|
|
|
enum SignalVariant : uint8_t {
|
2008-03-28 04:23:49 +01:00
|
|
|
SIG_ELECTRIC = 0, ///< Light signal
|
2011-12-19 18:48:04 +01:00
|
|
|
SIG_SEMAPHORE = 1, ///< Old-fashioned semaphore signal
|
2008-03-28 04:23:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Type of signal, i.e. how does the signal behave? */
|
2024-03-16 23:59:32 +01:00
|
|
|
enum SignalType : uint8_t {
|
2024-01-15 21:27:48 +01:00
|
|
|
SIGTYPE_BLOCK = 0, ///< block signal
|
2008-08-03 00:48:43 +02:00
|
|
|
SIGTYPE_ENTRY = 1, ///< presignal block entry
|
|
|
|
SIGTYPE_EXIT = 2, ///< presignal block exit
|
|
|
|
SIGTYPE_COMBO = 3, ///< presignal inter-block
|
|
|
|
SIGTYPE_PBS = 4, ///< normal pbs signal
|
|
|
|
SIGTYPE_PBS_ONEWAY = 5, ///< no-entry signal
|
2010-04-17 15:31:41 +02:00
|
|
|
|
|
|
|
SIGTYPE_END,
|
2008-08-03 00:48:43 +02:00
|
|
|
SIGTYPE_LAST = SIGTYPE_PBS_ONEWAY,
|
2011-12-19 18:48:04 +01:00
|
|
|
SIGTYPE_LAST_NOPBS = SIGTYPE_COMBO,
|
2008-03-28 04:23:49 +01:00
|
|
|
};
|
2024-01-16 22:01:28 +01:00
|
|
|
DECLARE_ENUM_AS_ADDABLE(SignalType)
|
2008-03-28 04:23:49 +01:00
|
|
|
|
2012-07-02 01:12:50 +02:00
|
|
|
/**
|
|
|
|
* These are states in which a signal can be. Currently these are only two, so
|
|
|
|
* simple boolean logic will do. But do try to compare to this enum instead of
|
|
|
|
* normal boolean evaluation, since that will make future additions easier.
|
|
|
|
*/
|
|
|
|
enum SignalState {
|
|
|
|
SIGNAL_STATE_RED = 0, ///< The signal is red
|
|
|
|
SIGNAL_STATE_GREEN = 1, ///< The signal is green
|
|
|
|
};
|
|
|
|
|
2008-03-28 04:23:49 +01:00
|
|
|
#endif /* SIGNAL_TYPE_H */
|