OpenTTD Source 20260621-master-g720d10536d
signal_type.h File Reference

Types and classes related to signals. More...

#include "core/enum_type.hpp"

Go to the source code of this file.

Enumerations

enum class  SignalVariant : uint8_t { Electric = 0 , Semaphore = 1 , End }
 Variant of the signal, i.e. More...
enum class  SignalType : uint8_t {
  Block = 0 , Entry = 1 , Exit = 2 , Combo = 3 ,
  Path = 4 , PathOneWay = 5 , End
}
 Type of signal, i.e. More...
enum class  SignalState : uint8_t { Red = 0 , Green = 1 , End }
 These are states in which a signal can be. More...

Detailed Description

Types and classes related to signals.

Definition in file signal_type.h.

Enumeration Type Documentation

◆ SignalState

enum class SignalState : uint8_t
strong

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.

Enumerator
Red 

The signal is red.

Green 

The signal is green.

End 

End marker.

Definition at line 40 of file signal_type.h.

◆ SignalType

enum class SignalType : uint8_t
strong

Type of signal, i.e.

how does the signal behave?

Enumerator
Block 

block signal.

Entry 

presignal block entry.

Exit 

presignal block exit.

Combo 

presignal inter-block.

Path 

normal path signal.

PathOneWay 

no-entry path signal.

End 

End marker.

Definition at line 24 of file signal_type.h.

◆ SignalVariant

enum class SignalVariant : uint8_t
strong

Variant of the signal, i.e.

how does the signal look?

Enumerator
Electric 

Light signal.

Semaphore 

Old-fashioned semaphore signal.

End 

End marker.

Definition at line 16 of file signal_type.h.