Route

class Route(source)

The ordered zones a transporter will cross to reach a destination, and how far along them it has come.

A route begins at the zone after the one the transporter currently holds, because the transporter is already in that zone and does not travel into it again, and ends at the destination's own zone. It is a value produced on demand and discarded when the movement ends: nothing owns it, nothing caches it, and two transporters given the same origin and destination receive separate routes, so one cannot disturb the other's progress.

The cursor only ever moves forward. A transporter that needs to go back the way it came is given a new route rather than being wound backwards along this one, which is what makes progress along a route monotone and what lets the movement engine treat "am I there yet" as a single comparison.

Parameters

origin

the zone the transporter held when the route was planned, not part of the sequence

destination

the intersection the route ends at

zones

the zones to cross, in order, ending with the destination's zone

Properties

Link copied to clipboard

True when every zone of the route has been entered.

Link copied to clipboard

The zone the transporter travels into next, or null when the route is complete.

Link copied to clipboard
Link copied to clipboard

The distance still to cover, including the zone being travelled into.

Link copied to clipboard

The zones not yet entered, in order.

Link copied to clipboard

The total distance the route covers.

Link copied to clipboard
Link copied to clipboard

How many zones remain, including the one the transporter is travelling into.

Link copied to clipboard

How many zones of this route the transporter has entered. Never decreases.

Functions

Link copied to clipboard
open override fun toString(): String