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
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
RequiresComponent<T>(WorldObjectItem)
Declaration
public static bool RequiresComponent<T>(this WorldObjectItem item)
Parameters
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