Class WorldObjectUtil
Inheritance
System.Object
WorldObjectUtil
Assembly: Eco.Gameplay.dll
Syntax
public static class WorldObjectUtil : Object
Methods
Declaration
public static void ActionPerformed(WorldObject obj, GameAction action)
Parameters
AllAttachedRecursiveAndSelf(WorldObject)
Gets all attached objects recursively (including self).
Declaration
public static IEnumerable<WorldObject> AllAttachedRecursiveAndSelf(this WorldObject obj)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<WorldObject> |
|
AllAttributesOnItemObjectOrComponent<T>(Type)
Declaration
public static IEnumerable<T> AllAttributesOnItemObjectOrComponent<T>(Type worldObjectType)
where T : Attribute
Parameters
| Type |
Name |
Description |
| System.Type |
worldObjectType |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
AllObjsWithComponent<T>()
Declaration
public static IEnumerable<T> AllObjsWithComponent<T>()
where T : WorldObjectComponent
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
Changed(Object, PropertyChangedEventArgs)
Declaration
public static void Changed(object controller, PropertyChangedEventArgs args)
Parameters
| Type |
Name |
Description |
| System.Object |
controller |
|
| System.ComponentModel.PropertyChangedEventArgs |
args |
|
CheckForPickUpAsync(WorldObject, Player, Boolean)
Confirms with the player pick up decision based on Eco.Gameplay.Objects.WorldObjectUtil.PickupConfirmation(Eco.Gameplay.Objects.WorldObject) and Contracts that depend on it.
Declaration
public static Task<bool> CheckForPickUpAsync(this WorldObject obj, Player player, bool confirm = true)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.Boolean> |
|
DestroyAndReturnInventories(WorldObject, LocString)
Destroy the object, returning all inventory items and the object item to a creator with void storage fallback.
Declaration
public static void DestroyAndReturnInventories(this WorldObject obj, LocString reason)
Parameters
ForceReturnPropertyObject(WorldObject)
Remove property object (e.g. claim stake), returning the papers and claim stake to their sources.
Declaration
public static void ForceReturnPropertyObject(this WorldObject hostObj)
Parameters
GetMayHaveComponents(Type, String, HashSet<(Type, String)>)
Declaration
public static void GetMayHaveComponents(Type type, string name, HashSet<(Type, string)> mayHaveComponentsSet)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.String |
name |
|
| System.Collections.Generic.HashSet<System.ValueTuple<System.Type, System.String>> |
mayHaveComponentsSet |
|
GetRequiredComponents(Type, String, HashSet<(Type, String)>)
Declaration
public static void GetRequiredComponents(Type type, string name, HashSet<(Type, string)> componentSet)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.String |
name |
|
| System.Collections.Generic.HashSet<System.ValueTuple<System.Type, System.String>> |
componentSet |
|
Handles(IEnumerable<WorldObject>)
Declaration
public static IEnumerable<WorldObjectHandle> Handles(this IEnumerable<WorldObject> objs)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<WorldObject> |
objs |
|
Returns
HasAttributeOnItemObjectOrComponent<T>(Type)
Declaration
public static bool HasAttributeOnItemObjectOrComponent<T>(Type worldObjectType)
where T : Attribute
Parameters
| Type |
Name |
Description |
| System.Type |
worldObjectType |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
RecursiveRequiredComponents(Type)
Declaration
public static IEnumerable<Type> RecursiveRequiredComponents(Type worldObjectType)
Parameters
| Type |
Name |
Description |
| System.Type |
worldObjectType |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Type> |
|
RequiresComponentNonRecursive<T>(WorldObjectItem)
Declaration
public static bool RequiresComponentNonRecursive<T>(this WorldObjectItem item)
where T : WorldObjectComponent
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
RequiresComponentRecursive<T>(WorldObjectItem)
Declaration
public static bool RequiresComponentRecursive<T>(this WorldObjectItem item)
where T : WorldObjectComponent
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
RequiresComponentRecursive<T>(Type)
Declaration
public static bool RequiresComponentRecursive<T>(Type type)
where T : WorldObjectComponent
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
ReturnAllInventoriesToCreator(WorldObject, LocString)
Return all inventories on this object to a creator with void storage fallback.
Declaration
public static void ReturnAllInventoriesToCreator(this WorldObject obj, LocString reason)
Parameters
SelfAndComponentsWithInterface<T>(WorldObject)
Return ourselves and any component that derives from the given interface.
Declaration
public static IEnumerable<T> SelfAndComponentsWithInterface<T>(this WorldObject obj)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
ShouldOverrideAuth(WorldObject, GameAction)
Declaration
public static LazyResult ShouldOverrideAuth(WorldObject obj, GameAction action)
Parameters
Returns
SimTickDelta(WorldObject)
Declaration
public static float SimTickDelta(this WorldObject obj)
Parameters
Returns
| Type |
Description |
| System.Single |
|
TryPickUp(WorldObject, GameActionPack, Player, Inventory, Single, Boolean, AccessType)
Declaration
public static GameActionPack TryPickUp(this WorldObject obj, GameActionPack actionPack, Player player, Inventory targetInventory, float caloriesNeeded, bool force, AccessType accessType)
Parameters
Returns
TryPickupComponents(WorldObject, WorldObjectUtil.PickupType, Inventory, User, GameActionPack, AccessType, Boolean)
Calls TryPickup for components in the WorldObject, and adds them to the inventory when possible.
Declaration
public static (InventoryMoveResult, GameActionPack) TryPickupComponents(this WorldObject obj, WorldObjectUtil.PickupType pickupType, Inventory targetInventory, User user, GameActionPack actionPack, AccessType accessNeeded, bool force)
Parameters
Returns
TryPickUpNow(WorldObject, Player, Inventory, Single, Boolean)
Declaration
public static Result TryPickUpNow(this WorldObject obj, Player player, Inventory targetInventory, float caloriesNeeded, bool force)
Parameters
Returns