Show / Hide Table of Contents

Class InteractionInfo

Information about an interaction, calculated on the client.

Inheritance
System.Object
InteractionInfo
Implements
IBsonSerialize
IBsonSerializable
IBsonDeserializable
Namespace: Eco.Shared.Items
Assembly: Eco.Shared.dll
Syntax
[BsonAutoSerialize]
public class InteractionInfo : Object, IBsonSerialize, IBsonSerializable, IBsonDeserializable

Constructors

InteractionInfo()

Declaration
public InteractionInfo()

Properties

BlockPosition

The targeted block, if set. Will not be set at the same time as TargetObject.

Declaration
public Nullable<Vector3i> BlockPosition { get; set; }
Property Value
Type Description
System.Nullable<Vector3i>

Distance

Distance to the interaction target.

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

FacingDirection

The facing direction of the player when performing the action.

Declaration
public DirectionAxisHorizontal FacingDirection { get; set; }
Property Value
Type Description
DirectionAxisHorizontal

ID

ID used to rewind bad predictions.

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

IsAirInteraction

Interact without a target is considered air interaction aka dropping block off a cliff. When true, Block Position is the position down the cliff.

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

Method

Method used to start the interaction.

Declaration
public InteractionMethod Method { get; set; }
Property Value
Type Description
InteractionMethod

Modifier

Any modifier key held down while triggering the interaction.

Declaration
public InteractionModifier Modifier { get; set; }
Property Value
Type Description
InteractionModifier

Normal

The facing direction of the side of the selected block. This is the side any placed block will be.

Declaration
public Nullable<Vector3i> Normal { get; set; }
Property Value
Type Description
System.Nullable<Vector3i>

Parameters

Custom interaction parameters.

Declaration
public BSONObject Parameters { get; set; }
Property Value
Type Description
BSONObject

Position

When TargetObject is not null, the position the interaction ray intersected with the target object.

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

TargetObject

The object being interacted with, if set. If this is set BlockPosition will be null.

Declaration
public INetObject TargetObject { get; set; }
Property Value
Type Description
INetObject

Methods

FromBson(BSONArray)

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

ToBson()

Declaration
public BSONArray ToBson()
Returns
Type Description
BSONArray

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