Route — a sequence of N tracks and N-1 switches between them.
Route has a reference to the train that created that route. The route only exists while the train is handled by the TrainMoveTo block.
The track where the head of the train was located in the beginning of movement has index 0. The target track has index N-1.
Function | Description |
---|---|
int size() |
Returns the number of tracks in the route, minimum 1.
The number of switches is the number of tracks minus 1.
|
RailwaySwitch getSwitch( int i ) |
Returns the switch with the given index. i — the index of the switch: 0 .. size()-2 |
RailwayTrack getTrack( int i ) |
Returns the track with the given index. i — the index of the track: 0 .. size()-1 |
-
How can we improve this article?
-