en
Sign in

← Back to the API reference

TrackChoice A chosen track

What a station's onTrackChosen gives when a train's agent chooses a track there: the train, the track and the station.

What for: To tell passengers which track a train arrives on.

stations.South.onTrackChosen { TrackChoice c ->
   announce "The ${c.train.name} arrives on track ${c.block.name}"
}

Properties

train → Train

The train.

The train.

stations.South.onTrackChosen { TrackChoice c -> log c.train.name }

block → Block

The track.

The chosen track.

stations.South.onTrackChosen { TrackChoice c -> log c.block.name }

place → Place

The station or yard.

The place the track lies in.

stations.South.onTrackChosen { TrackChoice c -> log c.place.name }