Show / Hide Table of Contents

Class AITarget

Inheritance
System.Object
AITarget
Namespace: Eco.Shared.Pathing
Assembly: Eco.Shared.dll
Syntax
public class AITarget : Object

Constructors

AITarget()

Declaration
public AITarget()

Properties

ArrivalTime

Declaration
public double ArrivalTime { get; }
Property Value
Type Description
System.Double

DesiredSpeed

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

DesiredVelocity

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

HasLookTarget

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

NextTick

Declaration
public double NextTick { get; }
Property Value
Type Description
System.Double

OverridePos

Declaration
public Nullable<Vector3> OverridePos { get; }
Property Value
Type Description
System.Nullable<System.Numerics.Vector3>

PathingRotationSpeed

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

Route

Declaration
public IEnumerable<Vector3> Route { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Numerics.Vector3>

RouteAndDesc

Declaration
public IEnumerable<(Vector3, string)> RouteAndDesc { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.ValueTuple<System.Numerics.Vector3, System.String>>

RouteFollower

Declaration
public RouteFollower RouteFollower { get; }
Property Value
Type Description
RouteFollower

RunningSpeed

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

TargetObjID

Declaration
public int TargetObjID { get; }
Property Value
Type Description
System.Int32

TargetPosition

Returns either the target object position (if available) and updates Eco.Shared.Pathing.AITarget.targetPos to last known position or returns Eco.Shared.Pathing.AITarget.targetPos with fallback to default value otherwise.

Declaration
public Nullable<Vector3> TargetPosition { get; }
Property Value
Type Description
System.Nullable<System.Numerics.Vector3>

TraversalData

Declaration
public TraversalData TraversalData { get; }
Property Value
Type Description
TraversalData

Methods

Clear()

Stop moving along any routes, and clear targets.

Declaration
public void Clear()

Describe()

Declaration
public string Describe()
Returns
Type Description
System.String

DesiredDirection(Single)

Declaration
public Vector3 DesiredDirection(float lookAhead = 0F)
Parameters
Type Name Description
System.Single lookAhead
Returns
Type Description
System.Numerics.Vector3

FromBSON(BSONObject, INetObjectViewer)

Declaration
public void FromBSON(BSONObject obj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject obj
INetObjectViewer viewer

Position(Single)

Declaration
public Vector3 Position(float timeOffset = 0F)
Parameters
Type Name Description
System.Single timeOffset
Returns
Type Description
System.Numerics.Vector3

SetFacing(Vector3)

Declaration
public void SetFacing(Vector3 dir)
Parameters
Type Name Description
System.Numerics.Vector3 dir

SetLook(Vector3i)

Sets look to fixed pos.

Declaration
public void SetLook(Vector3i pos)
Parameters
Type Name Description
Vector3i pos

SetLook(INetObjectPosition)

Sets look to followingTarget. If followingTarget is null then resets look target.

Declaration
public void SetLook(INetObjectPosition followingTarget)
Parameters
Type Name Description
INetObjectPosition followingTarget

SetPosition(Vector3)

Clear the route and set the position as passed.

Declaration
public void SetPosition(Vector3 pos)
Parameters
Type Name Description
System.Numerics.Vector3 pos

SetRoute(Route, INetObjectPosition, Single)

Sets route this agent will follow.

Declaration
public void SetRoute(Route route, INetObjectPosition targetOrganism = null, float delay = 0F)
Parameters
Type Name Description
Route route
INetObjectPosition targetOrganism

Object this agent should be looking at when following the route.

System.Single delay

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

StartTime()

Declaration
public double StartTime()
Returns
Type Description
System.Double

ToBSON(INetObjectViewer)

Declaration
public BSONObject ToBSON(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
BSONObject

TravelTime()

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

TryGetTargetObject(out INetObjectPosition)

Returns targetObj if it is set and available in NetObjectManager.

Declaration
public bool TryGetTargetObject(out INetObjectPosition targetObj)
Parameters
Type Name Description
INetObjectPosition targetObj
Returns
Type Description
System.Boolean

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