![]() |
DeskSim v2 0.1
Train simulator prototype created for Lokførerskolen
|
The central signal controller used for communication. More...
#include <CentralSignalController.h>
Public Member Functions | |
virtual void | Tick (float DeltaTime) override |
void | FindAllSignals () |
Finds all signals in the level, based on class. More... | |
void | FindAllTrains () |
Finds all trains in the level, based on class. More... | |
void | ReceiveInputSignal (FName SignalID, ESignalType SignalType, ESignalStatus Status) |
Receives signal updates from inputs and triggers, updates the relevant signals. More... | |
void | ReceiveInputStatus (FName TrainID) |
Receives emergency stop command, sends to the relevant trains. More... | |
void | SendUpdatedSignal (FName SignalID, ESignalType SignalType, ESignalStatus Status) |
Finds and sends signal updates to relevant signals. More... | |
void | UpdateRelatedSignals (FName SignalID, ESignalType SignalType, ESignalStatus Status) |
Performs conversion on signal status and type to update related signals. More... | |
void | SendTrainEmergencyStop (FName TrainID) |
Sends the emergency stop signal to TrainID. More... | |
void | TestAllEmergencyStop () |
Test function stopping all trains. | |
Public Attributes | |
TSubclassOf< ABasicSignal > | DwarfSignalBP |
Class reference of dwarf signal. | |
TSubclassOf< ABasicSignal > | MainSignalBP |
Class reference of main signal. | |
TSubclassOf< ABasicSignal > | ForwardSignalBP |
Class reference of forward signal. | |
TSubclassOf< ATrain > | TrainClass |
Base class reference of trains. | |
TArray< AActor * > | DwarfSignalActors |
Array storing all dwarf signal actors. | |
TArray< AActor * > | MainSignalActors |
Array storing all main signal actors. | |
TArray< AActor * > | ForwardSignalActors |
Array storing all forward signal actors. | |
TArray< AActor * > | AllSignalActors |
Array storing all signal actors. | |
TArray< AActor * > | AllTrainActors |
Array storing all train actors. | |
Protected Member Functions | |
virtual void | BeginPlay () override |
The central signal controller used for communication.
The controller is used to communicate between signals, trigger boxes, and trains. The controller mostly receives signals then forwards them to the correct actors. Only one is needed in the level at a time.
void ACentralSignalController::FindAllSignals | ( | ) |
Finds all signals in the level, based on class.
Stores all signals in arrays to be used later.
void ACentralSignalController::FindAllTrains | ( | ) |
Finds all trains in the level, based on class.
Stores all trains in an array.
void ACentralSignalController::ReceiveInputSignal | ( | FName | SignalID, |
ESignalType | SignalType, | ||
ESignalStatus | Status | ||
) |
Receives signal updates from inputs and triggers, updates the relevant signals.
SignalID | - The ID of the signal to update |
SignalType | - The type of signal to update |
Status | - The new status of the signal |
void ACentralSignalController::ReceiveInputStatus | ( | FName | TrainID | ) |
Receives emergency stop command, sends to the relevant trains.
TrainID | - The ID of the train to stop |
void ACentralSignalController::SendTrainEmergencyStop | ( | FName | TrainID | ) |
Sends the emergency stop signal to TrainID.
TrainID | - The ID of the train to stop |
void ACentralSignalController::SendUpdatedSignal | ( | FName | SignalID, |
ESignalType | SignalType, | ||
ESignalStatus | Status | ||
) |
Finds and sends signal updates to relevant signals.
Searches the list of relevant signals.
SignalID | - The Id of the signal to update |
SignalType | - The type of signal to update |
Status | - The new status of the signal |
void ACentralSignalController::UpdateRelatedSignals | ( | FName | SignalID, |
ESignalType | SignalType, | ||
ESignalStatus | Status | ||
) |
Performs conversion on signal status and type to update related signals.
SignalID | - The Id of the signal to update |
SignalType | - The type of signal to update |
Status | - The new status of the signal |