메소드 | 설명 | |
---|---|---|
GetSimulator ( ) : |
Gets the singleton simulator instance
|
|
GetTrainController ( ITrain train ) : TrainControllerLib.TrainController |
Gets a reference to the train controller of the train
|
|
PauseSimulation ( ) : void |
Pauses the simulation timer
|
|
SetSimulationSpeed ( double scale ) : bool |
Sets the simulation speed Scale of 1 is real time, scale of 10 is 10x real time, etc. |
|
SimulateBrakeFailure ( ITrain train, bool failure ) : void |
Simulates a train brake failure
|
|
SimulateBrokenRail ( TrackBlock block, bool failure ) : void |
Simulates a track broken rail
|
|
SimulateCircuitFailure ( TrackBlock block, bool failure ) : void |
Simulates a track block circuit failure
|
|
SimulateEngineFailure ( ITrain train, bool failure ) : void |
Simulates a train engine failure
|
|
SimulatePickupFailure ( ITrain train, bool failure ) : void |
Simulates a train pickup failure
|
|
SimulatePowerFailure ( TrackBlock block, bool failure ) : void |
Simulates a track block power failure
|
|
SpawnNewTrain ( TrackBlock initialBlock, string name ) : void |
Creates a new train on the track
|
|
StartSimulation ( ) : void |
Starts the simulation timer to update train positions
|
|
StopSimulation ( ) : void |
Stops the simulation and clears the lists of components to update
|
메소드 | 설명 | |
---|---|---|
OnSimulationTimerElapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void |
Timer elapsed
|
|
OnTrainAtStation ( ITrainController train, string stationName ) : void |
Train arrived at a station
|
|
OnTrainEnteredNewBlock ( TrackBlock previous, TrackBlock next ) : void |
A train entered a new track block. Need to push an update to the track controllers
|
|
Simulator ( ) : System |
Private constructor
|
public GetTrainController ( ITrain train ) : TrainControllerLib.TrainController | ||
train | ITrain | |
리턴 | TrainControllerLib.TrainController |
public SetSimulationSpeed ( double scale ) : bool | ||
scale | double | Simulation scale |
리턴 | bool |
public SimulateBrakeFailure ( ITrain train, bool failure ) : void | ||
train | ITrain | Train to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SimulateBrokenRail ( TrackBlock block, bool failure ) : void | ||
block | TrackBlock | Block to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SimulateCircuitFailure ( TrackBlock block, bool failure ) : void | ||
block | TrackBlock | Track block to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SimulateEngineFailure ( ITrain train, bool failure ) : void | ||
train | ITrain | Train to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SimulatePickupFailure ( ITrain train, bool failure ) : void | ||
train | ITrain | Train to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SimulatePowerFailure ( TrackBlock block, bool failure ) : void | ||
block | TrackBlock | Track block to simulate on |
failure | bool | True to invoke failure or false to clear it |
리턴 | void |
public SpawnNewTrain ( TrackBlock initialBlock, string name ) : void | ||
initialBlock | TrackBlock | Starting block of the train |
name | string | Name of the train |
리턴 | void |