Class InventoryRestriction
Restricts an inventory from accepting or applying an operation
Inheritance
Namespace: Eco.Gameplay.Items
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
Type | Description |
---|---|
LocString |
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},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 |
SurpassStackSize
Declaration
public virtual bool SurpassStackSize { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Type
See RestrictionType
Declaration
public virtual RestrictionType Type { get; }
Property Value
Type | Description |
---|---|
RestrictionType |
Methods
MaxAccepted(Item, Int32)
Custom handler for defining restriction max accepted rules.
Declaration
public virtual int MaxAccepted(Item item, int currentQuantity)
Parameters
Type | Name | Description |
---|---|---|
Item | item | |
System.Int32 | currentQuantity |
Returns
Type | Description |
---|---|
System.Int32 | The max amount of items that can be accepted. Otherwise -1 for default behavior. |
MaxAccepted(RestrictionCheckData, Item, Int32)
Custom handler for defining restriction max accepted rules.
Declaration
public virtual int MaxAccepted(RestrictionCheckData checkData, Item item, int currentQuantity)
Parameters
Type | Name | Description |
---|---|---|
RestrictionCheckData | checkData | |
Item | item | |
System.Int32 | currentQuantity |
Returns
Type | Description |
---|---|
System.Int32 | The max amount of items that can be accepted. Otherwise -1 for default behavior. |
MaxPickup(RestrictionCheckData, Item, Int32)
Custom handler for defining restriction pickup rules.
Declaration
public virtual int MaxPickup(RestrictionCheckData checkData, Item item, int currentQuantity)
Parameters
Type | Name | Description |
---|---|---|
RestrictionCheckData | checkData | |
Item | item | |
System.Int32 | currentQuantity |
Returns
Type | Description |
---|---|
System.Int32 | The max amount that can be picked up. Otherwise -1 for default behavior. |