Show / Hide Table of Contents

Class WorldObjectManager

Inheritance
System.Object
WorldObjectManager
Implements
IWorldObjectManager
IThreadedPlugin
IShutdownablePlugin
IServerPlugin
IInitializablePlugin
IDisplayablePlugin
IGUIPlugin
IHasDisplayTabs
IDisplayTab
IConfigurablePlugin
IEditablePlugin
Namespace: Eco.Gameplay.Objects
Assembly: Eco.Gameplay.dll
Syntax
public class WorldObjectManager : Object, IWorldObjectManager, IThreadedPlugin, IShutdownablePlugin, IServerPlugin, IInitializablePlugin, IDisplayablePlugin, IGUIPlugin, IHasDisplayTabs, IDisplayTab, IConfigurablePlugin, IEditablePlugin

Constructors

WorldObjectManager()

Declaration
public WorldObjectManager()

Fields

Init

Declaration
public static Initializer Init
Field Value
Type Description
Initializer

ItemDestoryedPermanently

Declaration
public static readonly ThreadSafeAction<Item> ItemDestoryedPermanently
Field Value
Type Description
ThreadSafeAction<Item>

WorldObjectAddedEvent

Declaration
public static readonly ThreadSafeAction<WorldObject, User> WorldObjectAddedEvent
Field Value
Type Description
ThreadSafeAction<WorldObject, User>

WorldObjectRemovedEvent

Declaration
public static readonly ThreadSafeAction<WorldObject> WorldObjectRemovedEvent
Field Value
Type Description
ThreadSafeAction<WorldObject>

WorldObjectTypeToComponentTypes

Declaration
public static Dictionary<Type, List<Type>> WorldObjectTypeToComponentTypes
Field Value
Type Description
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<System.Type>>

Properties

All

Declaration
public IEnumerable<WorldObject> All { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<WorldObject>

AllTypes

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

AllWorldObjectTypes

Declaration
public Dictionary<string, Type> AllWorldObjectTypes { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.Type>

ParamChanged

Declaration
public ThreadSafeAction<object, string> ParamChanged { get; set; }
Property Value
Type Description
ThreadSafeAction<System.Object, System.String>

PluginConfig

Declaration
public IPluginConfig PluginConfig { get; }
Property Value
Type Description
IPluginConfig

TickDeltaTime

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

TickStartTime

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

Methods

Add(WorldObject, User, WrappedWorldPosition3, Quaternion, WorldObject)

Declaration
public WorldObject Add(WorldObject worldObject, User creator, WrappedWorldPosition3 position, Quaternion rotation, WorldObject attachedToWorldObject)
Parameters
Type Name Description
WorldObject worldObject
User creator
WrappedWorldPosition3 position
Quaternion rotation
WorldObject attachedToWorldObject
Returns
Type Description
WorldObject

AddToTick(ITickOnDemand)

Adds tickable to closest (current or next) Eco.Gameplay.Objects.WorldObjectManager.TickAll which may not want to tick every time, but instead tick only when specific event happens. It may be useful if you wanna delay component state update until tick time, because it may have lot of updates between ticks and processing multiple syncs for every update may significantly impact performance. At same time we don't wanna to Tick() every time, because these syncs may not happen for long time for most of components and it will just waste CPU time.

Declaration
public void AddToTick(ITickOnDemand tickable)
Parameters
Type Name Description
ITickOnDemand tickable

DestroyPermanently(Item, Int32)

Declaration
public static void DestroyPermanently(Item item, int quantity = 1)
Parameters
Type Name Description
Item item
System.Int32 quantity

DestroyPermanently(WorldObject)

Declaration
public static void DestroyPermanently(WorldObject worldObject)
Parameters
Type Name Description
WorldObject worldObject

ForceAdd(Type, User, Vector3, Quaternion, Boolean, IPlaceableItem, Action<WorldObject>, WorldObject)

Declaration
public static WorldObject ForceAdd(Type worldObjectType, User creator, Vector3 position, Quaternion rotation, bool validatePlacement = true, IPlaceableItem item = null, Action<WorldObject> onInstanceCreated = null, WorldObject attachedToWorldObject = null)
Parameters
Type Name Description
System.Type worldObjectType
User creator
System.Numerics.Vector3 position
Quaternion rotation
System.Boolean validatePlacement
IPlaceableItem item
System.Action<WorldObject> onInstanceCreated
WorldObject attachedToWorldObject
Returns
Type Description
WorldObject

ForEach(Action<WorldObject>)

Declaration
public static void ForEach(Action<WorldObject> action)
Parameters
Type Name Description
System.Action<WorldObject> action

GetCategory()

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

GetDisplayText()

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

GetEditObject()

Declaration
public object GetEditObject()
Returns
Type Description
System.Object

GetFromID(Guid)

Declaration
public WorldObject GetFromID(Guid g)
Parameters
Type Name Description
System.Guid g
Returns
Type Description
WorldObject

GetObjectsWithin(Vector2, Single)

Declaration
public IEnumerable<WorldObject> GetObjectsWithin(Vector2 position, float range)
Parameters
Type Name Description
Vector2 position
System.Single range
Returns
Type Description
System.Collections.Generic.IEnumerable<WorldObject>

GetObjectsWithin(WrappedPosition3, Single)

Declaration
public IEnumerable<WorldObject> GetObjectsWithin(WrappedPosition3 position, float range)
Parameters
Type Name Description
WrappedPosition3 position
System.Single range
Returns
Type Description
System.Collections.Generic.IEnumerable<WorldObject>

GetOwnedBy(User)

Declaration
public static IEnumerable<WorldObject> GetOwnedBy(User user)
Parameters
Type Name Description
User user
Returns
Type Description
System.Collections.Generic.IEnumerable<WorldObject>

GetStatus()

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

GetTypeFromName(String)

Declaration
public Type GetTypeFromName(string s)
Parameters
Type Name Description
System.String s
Returns
Type Description
System.Type

GetWorldObjectsFromComponent(Type, Boolean)

We get all the world objects that have the specified component.

Declaration
public static IEnumerable<Type> GetWorldObjectsFromComponent(Type componentType, bool includeHiddenObjects = true)
Parameters
Type Name Description
System.Type componentType
System.Boolean includeHiddenObjects

Do we want to also get the hidden objects ?

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

Initialize(TimedTask)

Declaration
public void Initialize(TimedTask timer)
Parameters
Type Name Description
TimedTask timer

IsQueuedForTick(ITickOnDemand)

Declaration
public bool IsQueuedForTick(ITickOnDemand tickable)
Parameters
Type Name Description
ITickOnDemand tickable
Returns
Type Description
System.Boolean

OnDisplayTabVisibilityChange(Boolean)

Declaration
public void OnDisplayTabVisibilityChange(bool show)
Parameters
Type Name Description
System.Boolean show

OnEditObjectChanged(Object, String)

Declaration
public void OnEditObjectChanged(object o, string param)
Parameters
Type Name Description
System.Object o
System.String param

OnWorldObjectLoaded(WorldObject)

Declaration
public void OnWorldObjectLoaded(WorldObject worldObject)
Parameters
Type Name Description
WorldObject worldObject

RemoveFromTick(ITickOnDemand)

Declaration
public void RemoveFromTick(ITickOnDemand tickable)
Parameters
Type Name Description
ITickOnDemand tickable

RemoveWorldObject(WorldObject)

Declaration
public bool RemoveWorldObject(WorldObject worldObject)
Parameters
Type Name Description
WorldObject worldObject
Returns
Type Description
System.Boolean

Run()

Declaration
public void Run()

ShutdownAsync()

Declaration
public Task ShutdownAsync()
Returns
Type Description
System.Threading.Tasks.Task

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

TryMoveWorldObject(Player, IPlaceableItem, WorldObject, Vector3, Quaternion)

Attempts to move an already placed WorldObject to a new position.

Declaration
public static WorldObject TryMoveWorldObject(Player player, IPlaceableItem item, WorldObject worldObject, Vector3 newPosition, Quaternion newRotation)
Parameters
Type Name Description
Player player
IPlaceableItem item
WorldObject worldObject
System.Numerics.Vector3 newPosition
Quaternion newRotation
Returns
Type Description
WorldObject
Remarks

For stockpiles, calories will be used based on their total weight.

TryMoveWorldObjectFreecar(Player, IPlaceableItem, WorldObject, Vector3, Quaternion)

Same as TryMoveWorldObject but does not consume calories (e.g. for freecar command). Ignores laws, civics, and settlement restrictions.

Declaration
public static WorldObject TryMoveWorldObjectFreecar(Player player, IPlaceableItem item, WorldObject worldObject, Vector3 newPosition, Quaternion newRotation)
Parameters
Type Name Description
Player player
IPlaceableItem item
WorldObject worldObject
System.Numerics.Vector3 newPosition
Quaternion newRotation
Returns
Type Description
WorldObject

Implements

IWorldObjectManager
IThreadedPlugin
IShutdownablePlugin
IServerPlugin
IInitializablePlugin
IDisplayablePlugin
IGUIPlugin
IHasDisplayTabs
IDisplayTab
IConfigurablePlugin
IEditablePlugin

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