Open Rails

AETraveller.DistanceTo(Int32, Int32, Single, Single, Single, AETraveller) Method

[This is preliminary documentation and subject to change.]

Returns the distance from the traveller's current location, in its current direction, to the location specified.

public float DistanceTo(
   int tileX,
   int tileZ,
   float x,
   float y,
   float z,
   out AETraveller destination
);

Parameters

tileX
Target tile coordinate.
tileZ
Target tile coordinate.
x
Target coordinate.
y
Target coordinate.
z
Target coordinate.
destination
Traveller at the destination

Return Value

If the target is found, the distance from the traveller's current location, along the track nodes, to the specified location. If the target is not found, -1.

See Also

AETraveller Class | Orts.Formats.OR Namespace | AETraveller.DistanceTo Overload List