Show / Hide Table of Contents

Class WorldObjectUtil

Inheritance
System.Object
WorldObjectUtil
Namespace: Eco.Gameplay.Objects
Assembly: Eco.Gameplay.dll
Syntax
public static class WorldObjectUtil : Object

Methods

ActionPerformed(WorldObject, GameAction)

Declaration
public static void ActionPerformed(WorldObject obj, GameAction action)
Parameters
Type Name Description
WorldObject obj
GameAction action

AllObjsWithComponent<T>()

Declaration
public static IEnumerable<T> AllObjsWithComponent<T>()
    where T : WorldObjectComponent
Returns
Type Description
System.Collections.Generic.IEnumerable<T>
Type Parameters
Name Description
T

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
Type Name Description
WorldObject obj
Player player
System.Boolean confirm
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
Type Name Description
WorldObject obj
LocString reason

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
Type Name Description
WorldObject hostObj

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
Type Description
System.Collections.Generic.IEnumerable<WorldObjectHandle>

RequiresComponent<T>(WorldObjectItem)

Declaration
public static bool RequiresComponent<T>(this WorldObjectItem item)
Parameters
Type Name Description
WorldObjectItem item
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

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
Type Name Description
WorldObject obj
LocString reason

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
Type Name Description
WorldObject obj
Returns
Type Description
System.Collections.Generic.IEnumerable<T>
Type Parameters
Name Description
T

ShouldOverrideAuth(WorldObject, GameAction)

Declaration
public static LazyResult ShouldOverrideAuth(WorldObject obj, GameAction action)
Parameters
Type Name Description
WorldObject obj
GameAction action
Returns
Type Description
LazyResult

SimTickDelta(WorldObject)

Declaration
public static float SimTickDelta(this WorldObject obj)
Parameters
Type Name Description
WorldObject obj
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
Type Name Description
WorldObject obj
GameActionPack actionPack
Player player
Inventory targetInventory
System.Single caloriesNeeded
System.Boolean force
AccessType accessType
Returns
Type Description
GameActionPack

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
Type Name Description
WorldObject obj
WorldObjectUtil.PickupType pickupType
Inventory targetInventory
User user
GameActionPack actionPack
AccessType accessNeeded
System.Boolean force
Returns
Type Description
System.ValueTuple<InventoryMoveResult, GameActionPack>
Remarks

If any component 'TryPickup' instance succeeds, the actionPack won't fail and valid items will be moved. Changeset will be created in actionpack if null is passed

TryPickUpNow(WorldObject, Player, Inventory, Single, Boolean)

Declaration
public static Result TryPickUpNow(this WorldObject obj, Player player, Inventory targetInventory, float caloriesNeeded, bool force)
Parameters
Type Name Description
WorldObject obj
Player player
Inventory targetInventory
System.Single caloriesNeeded
System.Boolean force
Returns
Type Description
Result
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾