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

object ← InventoryStack

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

ItemDefinition

IsEmpty

Gets whether the slot or stack contains no items.

public bool IsEmpty { get; }

Property Value

bool

IsFull

Gets whether the stack is at its configured maximum quantity.

public bool IsFull { get; }

Property Value

bool

Items

Gets the runtime item instances contained in this stack.

public IReadOnlyList<ItemInstance> Items { get; }

Property Value

IReadOnlyList<ItemInstance>

MaximumQuantity

Gets the maximum number of items allowed in this stack.

public int MaximumQuantity { get; }

Property Value

int

Quantity

Gets the number of runtime items in this stack or slot.

public int Quantity { get; }

Property Value

int

RemainingCapacity

Gets the number of additional items the stack can accept.

public int RemainingCapacity { get; }

Property Value

int

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

bool

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

bool

Whether the specified condition is satisfied.