Class InventoryRestriction
Restricts an inventory from accepting or applying an operation
Inheritance
System.Object
InventoryRestriction
Assembly: Eco.Gameplay.dll
Syntax
public abstract class InventoryRestriction : Object
Constructors
InventoryRestriction()
Declaration
protected InventoryRestriction()
Properties
Message
Localized message shown to the user when the restriction checks do not pass.
Declaration
public abstract LocString Message { get; }
Property Value
Priority
The priority of the restriction. Used to find the most important restriction (Eco.Gameplay.Items.Inventory.CheckRestrictions(Eco.Gameplay.Items.Inventory.RestrictionCheckType,Eco.Gameplay.Items.Item,System.Int32,System.Func{Eco.Gameplay.Items.InventoryRestriction,System.Int32,System.Int32},Eco.Gameplay.Items.InventoryRestriction@))
from all of the applied restrictions for a given inventory stack.
Declaration
public virtual int Priority { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Type
Declaration
public virtual RestrictionType Type { get; }
Property Value
Methods
MaxAccepted(Item)
Custom handler for defining restriction max accepted rules.
Declaration
public virtual int MaxAccepted(Item item)
Parameters
| Type |
Name |
Description |
| Item |
item |
|
Returns
| Type |
Description |
| System.Int32 |
The max amount of items that can be accepted. Otherwise -1 for default behavior.
|
MaxAccepted(Item, Int32)
Declaration
public virtual int MaxAccepted(Item item, int quantity)
Parameters
| Type |
Name |
Description |
| Item |
item |
|
| System.Int32 |
quantity |
|
Returns
| Type |
Description |
| System.Int32 |
|
MaxAccepted(RestrictionCheckData, Item)
Custom handler for defining restriction max accepted rules.
Declaration
public virtual int MaxAccepted(RestrictionCheckData checkData, Item item)
Parameters
Returns
| Type |
Description |
| System.Int32 |
The max amount of items that can be accepted. Otherwise -1 for default behavior.
|
MaxAccepted(RestrictionCheckData, Item, Int32)
Declaration
public virtual int MaxAccepted(RestrictionCheckData checkData, Item item, int quantity)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
MaxPickup(RestrictionCheckData, Item, Int32)
Custom handler for defining restriction pickup rules.
Declaration
public virtual int MaxPickup(RestrictionCheckData checkData, Item item, int totalMoved)
Parameters
Returns
| Type |
Description |
| System.Int32 |
The max amount that can be picked up. Otherwise -1 for default behavior.
|
Extension Methods