Namespace: GGG.Inventory
Runtime collection of item instances sharing the same ItemDefinition. Every item keeps its own runtime identity even while stacked.
public sealed class InventoryStack
Inheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties
Definition
Gets the definition associated with this runtime instance.
public ItemDefinition Definition { get; }
Property Value
IsEmpty
Gets whether the slot or stack contains no items.
public bool IsEmpty { get; }
Property Value
IsFull
Gets whether the stack is at its configured maximum quantity.
public bool IsFull { get; }
Property Value
Items
Gets the runtime item instances contained in this stack.
public IReadOnlyList<ItemInstance> Items { get; }
Property Value
MaximumQuantity
Gets the maximum number of items allowed in this stack.
public int MaximumQuantity { get; }
Property Value
Quantity
Gets the number of runtime items in this stack or slot.
public int Quantity { get; }
Property Value
RemainingCapacity
Gets the number of additional items the stack can accept.
public int RemainingCapacity { get; }
Property Value
Methods
CanAccept(ItemInstance)
Determines whether the stack can accept another item instance.
public bool CanAccept(ItemInstance item)
Parameters
item ItemInstance
The runtime item instance to inspect or modify.
Returns
Whether the specified condition is satisfied.
Contains(ItemInstance)
Determines whether the collection contains the specified value.
public bool Contains(ItemInstance item)
Parameters
item ItemInstance
The runtime item instance to inspect or modify.
Returns
Whether the specified condition is satisfied.