Show / Hide Table of Contents

Class RubbleObject

Represents rubble object. These objects are physicly simulated some time and frozen after that. It's done for optimization reasons so rubbles not gonna be simulated forever.

Inheritance
System.Object
RubbleObject
RubbleObject<TItemType>
Implements
INetObjectPosition
IPositionAndBounds
IFreezable
INetObject
IEcoObject
IPickupable
IHasInteractions
Namespace: Eco.Gameplay.Objects
Assembly: Eco.Gameplay.dll
Syntax
[ChatCommandHandler]
public abstract class RubbleObject : Object, INetObjectPosition, IPositionAndBounds, IFreezable, INetObject, IEcoObject, IPickupable, IHasInteractions

Constructors

RubbleObject()

Declaration
protected RubbleObject()

Fields

MaxAmountPerBlock

Declaration
public const int MaxAmountPerBlock = 4
Field Value
Type Description
System.Int32

Properties

Active

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

Bounds

Declaration
public Rect Bounds { get; }
Property Value
Type Description
Rect

GroundDistance

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

ID

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

IsBreakable

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

NetEntity

Declaration
public NetPhysicsEntity NetEntity { get; }
Property Value
Type Description
NetPhysicsEntity

NetObjectCreationRealtime

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

PickingUp

This flag should be set when rubble is picking up to prevent concurrent picking same rubble. If you can't set this flag then usually you just need to skip the rubble.

Declaration
public ref ConcurrentFlag PickingUp { get; }
Property Value
Type Description
ConcurrentFlag

Position

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

Rotation

Declaration
public Quaternion Rotation { get; set; }
Property Value
Type Description
Quaternion

SpawnOffset

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

SubRubbleTypes

Declaration
public Type[] SubRubbleTypes { get; }
Property Value
Type Description
System.Type[]

UpdateChannel

Declaration
public NetworkChannel UpdateChannel { get; }
Property Value
Type Description
NetworkChannel

Methods

BecomesRubble(Type)

Declaration
public static bool BecomesRubble(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Boolean

Breakup(Player)

Breaks the chunk of rubble into pieces

Declaration
public List<RubbleObject> Breakup(Player player)
Parameters
Type Name Description
Player player
Returns
Type Description
System.Collections.Generic.List<RubbleObject>

List of the rubble pieces

ClearRubble(User, Single)

Declaration
[ChatSubCommand]
public static void ClearRubble(User user, float radius = 10F)
Parameters
Type Name Description
User user
System.Single radius

Destroy()

Declaration
public void Destroy()

GetRandomRubble(Type)

Returns random rubble type from block's meta info if it exists.

Declaration
public static Type GetRandomRubble(Type blockType)
Parameters
Type Name Description
System.Type blockType
Returns
Type Description
System.Type

IsNotRelevant(INetObjectViewer)

Declaration
public bool IsNotRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsRelevant(INetObjectViewer)

Declaration
public bool IsRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsUpdated(INetObjectViewer)

Declaration
public bool IsUpdated(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

Pickup(Player, InteractionTarget, Inventory, INetObject)

Declaration
public abstract Task<bool> Pickup(Player player, InteractionTarget target, Inventory targetInv, INetObject toolUsed)
Parameters
Type Name Description
Player player
InteractionTarget target
Inventory targetInv
INetObject toolUsed
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

ReceiveInitialState(BSONObject)

Declaration
public void ReceiveInitialState(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

ReceiveUpdate(BSONObject)

Declaration
public void ReceiveUpdate(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

SendInitialState(BSONObject, INetObjectViewer)

Declaration
public void SendInitialState(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

SendUpdate(BSONObject, INetObjectViewer)

Declaration
public void SendUpdate(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

SpawnRubble(User, String, Int32)

Declaration
[ChatSubCommand]
public static void SpawnRubble(User user, string blockTypeName = "Granite", int rubble = 32)
Parameters
Type Name Description
User user
System.String blockTypeName
System.Int32 rubble

TrySpawnFromBlock(Player, Type, Vector3, Int32)

Declaration
public static bool TrySpawnFromBlock(Player player, Type blockType, Vector3 position, int forced = -1)
Parameters
Type Name Description
Player player
System.Type blockType
System.Numerics.Vector3 position
System.Int32 forced
Returns
Type Description
System.Boolean

Implements

INetObjectPosition
IPositionAndBounds
IFreezable
INetObject
IEcoObject
IPickupable
IHasInteractions

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾