Open Rails

AETraveller.DistanceTo(Int32, Int32, Single, Single, Single, Single) 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,
   float maxDistance
);

Parameters

tileX
Target tile coordinate.
tileZ
Target tile coordinate.
x
Target coordinate.
y
Target coordinate.
z
Target coordinate.
maxDistance
MAximum distance to search for specified location.

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