Show / Hide Table of Contents

Class Route

An immutable set of line segments determining a path. All routes must have at least two waypoints for start/finish.

Inheritance
System.Object
Route
Namespace: Eco.Shared.Pathing
Assembly: Eco.Shared.dll
Syntax
public sealed class Route : ValueType

Constructors

Route(TraversalData, Vector3, PathSegment[], Boolean)

Declaration
public Route(TraversalData traversal, Vector3 facing, PathSegment[] pathSegments, bool isSmoothened)
Parameters
Type Name Description
TraversalData traversal
System.Numerics.Vector3 facing
PathSegment[] pathSegments
System.Boolean isSmoothened

Route(ReadOnlySpan<Byte>)

Declaration
public Route(ReadOnlySpan<byte> bytes)
Parameters
Type Name Description
System.ReadOnlySpan<System.Byte> bytes

Fields

IsSmoothened

Declaration
public readonly bool IsSmoothened
Field Value
Type Description
System.Boolean

StartingFacingDir

Declaration
public readonly Vector3 StartingFacingDir
Field Value
Type Description
System.Numerics.Vector3

TraversalData

Declaration
public readonly TraversalData TraversalData
Field Value
Type Description
TraversalData

Waypoints

Declaration
public readonly PathSegment[] Waypoints
Field Value
Type Description
PathSegment[]

Properties

EndDirection

Declaration
public Vector3 EndDirection { get; }
Property Value
Type Description
System.Numerics.Vector3

EndPosition

Declaration
public Vector3 EndPosition { get; }
Property Value
Type Description
System.Numerics.Vector3

IsValid

Declaration
public bool IsValid { get; }
Property Value
Type Description
System.Boolean

StartDirection

Declaration
public Vector3 StartDirection { get; }
Property Value
Type Description
System.Numerics.Vector3

StartPosition

Declaration
public Vector3 StartPosition { get; }
Property Value
Type Description
System.Numerics.Vector3

TotalDistance

Declaration
public float TotalDistance { get; }
Property Value
Type Description
System.Single

Methods

CheckPointsWrappedProperly(Vector3[])

Declaration
public static void CheckPointsWrappedProperly(Vector3[] pts)
Parameters
Type Name Description
System.Numerics.Vector3[] pts

FindPathSegmentIndexAtTime(Single, Int32)

Finds PathSegment index covering time starting at path segment with index start.

Declaration
public int FindPathSegmentIndexAtTime(float time, int start = 0)
Parameters
Type Name Description
System.Single time
System.Int32 start
Returns
Type Description
System.Int32

ToBytes()

Declaration
public byte[] ToBytes()
Returns
Type Description
System.Byte[]

TravelTime()

Declaration
public float TravelTime()
Returns
Type Description
System.Single

WaypointsAtTime(Single, Int32)

Adding a start value, allows us to start searching for the next waypoint midway through the path.

Declaration
public (PathSegment, PathSegment, int) WaypointsAtTime(float time, int start = 0)
Parameters
Type Name Description
System.Single time
System.Int32 start
Returns
Type Description
System.ValueTuple<PathSegment, PathSegment, System.Int32>

WithDelay(Single)

Creates a new route that is an exact copy of this route, but with delay added to start.

Declaration
public Route WithDelay(float delay)
Parameters
Type Name Description
System.Single delay

Start of the route is delayed by this number of seconds by adding them to initial rotation time.

Returns
Type Description
Route
Remarks

If delay is set to 0 this method just retuns this instance of Route.

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾