Class InteractableStorage
Defines interactions that storages which should have put/take available can use.
Inheritance
System.Object
InteractableStorage
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public abstract class InteractableStorage : StorageComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions, IInventoryWorldObjectComponent, IPermanentDestroyHandler, ICanOverrideAuth, IHasEnvVars
Constructors
InteractableStorage()
Declaration
protected InteractableStorage()
Properties
CanTakeAll
Declaration
[EnvVar]
public bool CanTakeAll { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
CanPut(User)
Declaration
[EnvVar]
public bool CanPut(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
CanTake(User)
Declaration
[EnvVar]
public Item CanTake(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
GetItemsUserCanTake(WorldObject, User, Item, Item, Boolean, Func<ItemStack, Item, Boolean>)
Get items available to user in this inventory
Declaration
public List<Item> GetItemsUserCanTake(WorldObject worldObject, User user, Item carriedItem, Item selectedItem, bool tryTakeAll = false, Func<ItemStack, Item, bool> restrictionsPassed = null)
Parameters
Type |
Name |
Description |
WorldObject |
worldObject |
|
User |
user |
|
Item |
carriedItem |
|
Item |
selectedItem |
|
System.Boolean |
tryTakeAll |
|
System.Func<ItemStack, Item, System.Boolean> |
restrictionsPassed |
possible restrictions of other inventories
|
Returns
Type |
Description |
System.Collections.Generic.List<Item> |
|
Declaration
[EnvVar]
public bool HoldingTool(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
Initialize()
Declaration
public override void Initialize()
Overrides
PutItem(Player, InteractionTriggerInfo, InteractionTarget)
2 interactions to separate put with a tool in hand and without, so tool has an animation and hand doesnt. the one with more restrictions (in this case extra requiredEnvVar:HoldingTool, should always be first.
Declaration
[Interaction]
[Interaction]
public void PutItem(Player player, InteractionTriggerInfo trigger, InteractionTarget target)
Parameters
Take(User, InteractionTarget, Boolean)
Declaration
public void Take(User user, InteractionTarget target, bool takeAll = false)
Parameters
TakeItem(Player, InteractionTriggerInfo, InteractionTarget)
Declaration
[Interaction]
[Interaction]
public void TakeItem(Player player, InteractionTriggerInfo trigger, InteractionTarget target)
Parameters
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods