Time Table

Parent

Contains the time table information of train.

Properties

numStops : Int

The current number of stops in the time table.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Num Stops

Functions

addStop (index : Int, station : Trace<RailroadStation>, ruleSet : Struct<TrainDockingRuleSet>) → added : Bool

Adds a stop to the time table.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Add Stop

Parameters
Name Type Description

Index index

Int

The zero-based index at which the stop should get added.

Station station

Trace<RailroadStation>

The railroad station at which the stop should happen.

Rule Set ruleSet

Struct<TrainDockingRuleSet>

The docking rule set that descibes when the train will depart from the station.

Return Values
Name Type Description

Added added

Bool

True if the stop got sucessfully added to the time table.

getCurrentStop () → index : Int

Returns the index of the stop the train drives to right now.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Current Stop

Return Values
Name Type Description

Index index

Int

The zero-based index of the stop the train tries to drive to right now.

getStop (index : Int) → stop : Struct<TimeTableStop>

Returns the stop at the given index.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Stop

Parameters
Name Type Description

Index index

Int

The zero-based index of the stop you want to get.

Return Values
Name Type Description

Stop stop

Struct<TimeTableStop>

The time table stop at the given index.

getStops () → stops : Array<Struct<TimeTableStop>>

Returns a list of all the stops this time table has

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Stops

Return Values
Name Type Description

Stops stops

Array<Struct<TimeTableStop>>

A list of time table stops this time table has.

incrementCurrentStop ()

Sets the current stop to the next stop in the time table.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Increment Current Stop

isValidStop (index : Int) → valid : Bool

Allows to check if the given stop index is valid.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Is Valid Stop

Parameters
Name Type Description

Index index

Int

The zero-based stop index you want to check its validity.

Return Values
Name Type Description

Valid valid

Bool

True if the stop index is valid.

removeStop (index : Int)

Removes the stop with the given index from the time table.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Remove Stop

Parameters
Name Type Description

Index index

Int

The zero-based index at which the stop should get added.

setCurrentStop (index : Int)

Sets the stop, to which the train trys to drive to right now.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Set Current Stop

Parameters
Name Type Description

Index index

Int

The zero-based index of the stop the train should drive to right now.

setStop (index : Int, stop : Struct<TimeTableStop>) → success : Bool

Allows to override a stop already in the time table.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Set Stop

Parameters
Name Type Description

Index index

Int

The zero-based index of the stop you want to override.

Stop stop

Struct<TimeTableStop>

The time table stop you want to override with.

Return Values
Name Type Description

Success success

Bool

True if setting was successful, false if not, f.e. invalid index.

setStops (stops : Array<Struct<TimeTableStop>>) → gotSet : Bool

Allows to empty and fill the stops of this time table with the given list of new stops.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Set Stops

Parameters
Name Type Description

Stops stops

Array<Struct<TimeTableStop>>

The new time table stops.

Return Values
Name Type Description

Got Set gotSet

Bool

True if the stops got sucessfully set.