Train

Parent

This class holds information and references about a trains (a collection of multiple railroad vehicles) and its timetable f.e.

Properties

dockState : Int

The current docking state of the train.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Dock State

hasTimeTable : Bool

True if the train has currently a time table.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Has Time Table

isDocked : Bool

True if the train is currently docked.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Is Docked

isPlayerDriven : Bool

True if the train is currently player driven.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Is Player Driven

isSelfDriving : Bool

True if the train is currently self driving.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Is Self Driving

selfDrivingError : Int

The last self driving error. 0 = No Error 1 = No Power 2 = No Time Table 3 = Invalid Next Stop 4 = Invalid Locomotive Placement 5 = No Path

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Self Driving Error

Functions

dock ()

Trys to dock the train to the station it is currently at.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Dock

getFirst () → first : Trace<RailroadVehicle>

Returns the first railroad vehicle that is part of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get First

Return Values
Name Type Description

First first

Trace<RailroadVehicle>

The first railroad vehicle that is part of this train.

getLast () → last : Trace<RailroadVehicle>

Returns the last railroad vehicle that is part of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Last

Return Values
Name Type Description

Last last

Trace<RailroadVehicle>

The last railroad vehicle that is part of this train.

getMaster () → master : Trace<RailroadVehicle>

Returns the master locomotive that is part of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Master

Return Values
Name Type Description

Master master

Trace<RailroadVehicle>

The master locomotive of this train.

getName () → name : String

Returns the name of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Name

Return Values
Name Type Description

Name name

String

The name of this train.

getTimeTable () → timeTable : Trace<TimeTable>

Returns the timetable of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Time Table

Return Values
Name Type Description

Time Table timeTable

Trace<TimeTable>

The timetable of this train.

getTrackGraph () → track : Struct<TrackGraph>

Returns the track graph of which this train is part of.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Track Graph

Return Values
Name Type Description

Track track

Struct<TrackGraph>

The track graph of which this train is part of.

getVehicles () → vehicles : Array<Trace<RailroadVehicle>>

Returns a list of all the vehicles this train has.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Vehicles

Return Values
Name Type Description

Vehicles vehicles

Array<Trace<RailroadVehicle>>

A list of all the vehicles this train has.

newTimeTable () → timeTable : Trace<TimeTable>

Creates and returns a new timetable for this train.

Details

Flags

RuntimeSync MemberFunc

Display Name

New Time Table

Return Values
Name Type Description

Time Table timeTable

Trace<TimeTable>

The new timetable for this train.

setName (name : String)

Allows to set the name of this train.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Set Name

Parameters
Name Type Description

Name name

String

The new name of this trian.

setSelfDriving (selfDriving : Bool)

Allows to set if the train should be self driving or not.

Details

Flags

RuntimeSync MemberFunc

Display Name

Set Self Driving

Parameters
Name Type Description

Self Driving selfDriving

Bool

True if the train should be self driving.

Signals

SelfDrvingUpdate (Bool Enabled enabled)

Triggers when the self driving mode of the train changes

Details
Parameters
Name Type Description

Enabled enabled

Bool

True if the train is now self driving.