Show / Hide Table of Contents

Class Path

Inheritance
System.Object
Path
Implements
IBsonSerialize
IBsonSerializable
IBsonDeserializable
Namespace: Eco.Shared.Pathing
Assembly: Eco.Shared.dll
Syntax
public sealed class Path : Object, IBsonSerialize, IBsonSerializable, IBsonDeserializable

Constructors

Path()

Declaration
public Path()

Path(IEnumerable<Vector3>)

Declaration
public Path(IEnumerable<Vector3> waypoints)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Numerics.Vector3> waypoints

Fields

Waypoints

Declaration
public Vector3[] Waypoints
Field Value
Type Description
System.Numerics.Vector3[]

Methods

DistanceToNextJump(Int32, Vector3)

Declaration
public float DistanceToNextJump(int segmentIndex, Vector3 currentPos)
Parameters
Type Name Description
System.Int32 segmentIndex
System.Numerics.Vector3 currentPos
Returns
Type Description
System.Single

DistanceToNextJump(Int32, Vector3, out Int32)

Declaration
public float DistanceToNextJump(int segmentIndex, Vector3 currentPos, out int segment)
Parameters
Type Name Description
System.Int32 segmentIndex
System.Numerics.Vector3 currentPos
System.Int32 segment
Returns
Type Description
System.Single

FromBson(BSONArray)

Declaration
public void FromBson(BSONArray bson)
Parameters
Type Name Description
BSONArray bson

GetNearestPointWithExtra(Int32, Vector3, Single)

Function to get the nearest point on the path and advance by a given distance. NOTE: Will only match ~same Y position, higher segments will not match for current position. Extra will be calculated until an up/down transition, where it will stop and return the POST-JUMP position (the end of the transition segment). Returns the point and the segment index (segment X starts at Waypoints[X])

Declaration
public (int, Vector3, int, Vector3) GetNearestPointWithExtra(int currentSegment, Vector3 position, float extra)
Parameters
Type Name Description
System.Int32 currentSegment
System.Numerics.Vector3 position
System.Single extra
Returns
Type Description
System.ValueTuple<System.Int32, System.Numerics.Vector3, System.Int32, System.Numerics.Vector3>

OnFinalStretch()

Returns true if we're on the last set of segments that will lead to the end, with no jumps.

Declaration
public bool OnFinalStretch()
Returns
Type Description
System.Boolean

SegmentDelta(Int32)

Returns a vector representing the change in position for this segment

Declaration
public Vector3 SegmentDelta(int segmentIndex)
Parameters
Type Name Description
System.Int32 segmentIndex
Returns
Type Description
System.Numerics.Vector3

ToBson()

Declaration
public BSONArray ToBson()
Returns
Type Description
BSONArray

VerticalTransitionSegment(Int32)

Returns true if the given segment goes up/down

Declaration
public bool VerticalTransitionSegment(int segment)
Parameters
Type Name Description
System.Int32 segment
Returns
Type Description
System.Boolean

VerticalTransitionSegment(Int32, Int32)

Declaration
public bool VerticalTransitionSegment(int segment, int checkForward)
Parameters
Type Name Description
System.Int32 segment
System.Int32 checkForward
Returns
Type Description
System.Boolean

Implements

IBsonSerialize
IBsonSerializable
IBsonDeserializable

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
☀
☾