Class ItemStack
Inheritance
System.Object
ItemStack
Implements
System.ComponentModel.INotifyPropertyChanged
System.ICloneable
Assembly: Eco.Gameplay.dll
Syntax
public class ItemStack : Object, IController, IViewController, IHasUniversalID, IStack, INotifyPropertyChanged, ICloneable
Constructors
ItemStack()
Declaration
ItemStack(Item, Int32, Inventory)
Declaration
public ItemStack(Item item, int quantity, Inventory parent = null)
Parameters
Type |
Name |
Description |
Item |
item |
|
System.Int32 |
quantity |
|
Inventory |
parent |
|
ItemStack(Type, Int32, Inventory)
Declaration
public ItemStack(Type type, int quantity, Inventory parent = null)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
System.Int32 |
quantity |
|
Inventory |
parent |
|
Properties
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
Type |
Description |
System.Int32 |
|
FractionalQuantity
Declaration
public float FractionalQuantity { get; set; }
Property Value
Type |
Description |
System.Single |
|
Item
Declaration
[NewTooltipChildren]
public Item Item { get; set; }
Property Value
Parent
Declaration
public Inventory Parent { get; }
Property Value
Quantity
Declaration
public int Quantity { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
StackObject
Declaration
public virtual ItemRepresentation StackObject { get; set; }
Property Value
TypeString
Declaration
public virtual string TypeString { get; }
Property Value
Type |
Description |
System.String |
|
Weight
Declaration
public float Weight { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
CanFit(Int32)
Declaration
public bool CanFit(int more)
Parameters
Type |
Name |
Description |
System.Int32 |
more |
|
Returns
Type |
Description |
System.Boolean |
|
Clear()
Clear item and quantity (leave Inventory alone)
Declaration
Clone()
Declaration
Returns
CloneStack()
Clones the underlying item, if its unique.
Declaration
public ItemStack CloneStack()
Returns
Deconstruct(out Item, out Int32)
Declaration
public void Deconstruct(out Item item, out int quantity)
Parameters
Type |
Name |
Description |
Item |
item |
|
System.Int32 |
quantity |
|
FilledPercent()
Declaration
public float FilledPercent()
Returns
Type |
Description |
System.Single |
|
ModifyFractional(Item, Single, User)
Declaration
public void ModifyFractional(Item item, float fractional, User user = null)
Parameters
Type |
Name |
Description |
Item |
item |
|
System.Single |
fractional |
|
User |
user |
The user that's doing the replacement.
|
NumberToTake(Item, Int32)
Declaration
public virtual int NumberToTake(Item item, int quantity)
Parameters
Type |
Name |
Description |
Item |
item |
|
System.Int32 |
quantity |
|
Returns
Type |
Description |
System.Int32 |
|
ReplaceStack(Item, Int32, Boolean, User)
Declaration
public void ReplaceStack(Item item, int quantity, bool notifyParentInventory, User user = null)
Parameters
Type |
Name |
Description |
Item |
item |
|
System.Int32 |
quantity |
|
System.Boolean |
notifyParentInventory |
We set this to true when we want the parent inventory to be automatically notified about the stack change.
We set it to false in the rare cases where we actually want to do that manually. (I.E when we want to replace many stacks in an inventory, it's better to do that and then notify the inventory in the end for better performance).
|
User |
user |
The user that's doing the replacement.
|
Sync()
Declaration
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
Description |
System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.ComponentModel.INotifyPropertyChanged
System.ICloneable
Extension Methods