MovePathIfc

interface MovePathIfc(source)

The geometry a journey is made through: where the vehicle is, how far things are, and how to say where between two places is.

The half of movement that differs between substrates. InterpolatedMovement is the other half -- the clockwork -- and it is written once because everything substrate-specific is here.

positionAlong may answer null, and that is a supported answer rather than a failure. A plane can say where a third of the way from A to B is; a table of pairwise distances cannot, and neither can a great-circle model without spherical interpolation nobody has asked for. A geometry that cannot say makes a journey one step: the vehicle waits out the whole leg and arrives, which is exactly what a free-path move has always done.

Properties

Link copied to clipboard
abstract val positionNow: LocationIfc

Where the vehicle is at this instant.

Functions

Link copied to clipboard
abstract fun distanceBetween(from: LocationIfc, to: LocationIfc): Double

How far apart two places are, by this geometry's own metric.

Link copied to clipboard
abstract fun isReachable(destination: LocationIfc): Boolean

True when the vehicle could get to destination at all.

Link copied to clipboard
abstract fun placeAt(location: LocationIfc)

Puts the vehicle at location. The only way this machinery moves anything.

Link copied to clipboard
abstract fun positionAlong(from: LocationIfc, to: LocationIfc, fraction: Double): LocationIfc?

Where fraction of the way from from to to is, or null when this geometry cannot say.