InventoryChange

Struct

Namespace: GGG.Inventory

Describes a successful inventory mutation. A slot index of -1 means that no specific slot applies. Definition may be null for swaps/clears.

public readonly struct InventoryChange

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

InventoryChange(InventoryChangeType, int, int, ItemDefinition, int)

Creates a new InventoryChange instance.

public InventoryChange(InventoryChangeType changeType, int primarySlotIndex, int secondarySlotIndex, ItemDefinition definition, int quantity)

Parameters

changeType InventoryChangeType

The category of the state change.

primarySlotIndex int

The index of the primary inventory slot.

secondarySlotIndex int

The index of the secondary inventory slot.

definition ItemDefinition

The item or inventory definition to inspect or use.

quantity int

The requested quantity of items.

Properties

ChangeType

Gets the change type.

public InventoryChangeType ChangeType { get; }

Property Value

InventoryChangeType

Definition

Gets the definition associated with this runtime instance.

public ItemDefinition Definition { get; }

Property Value

ItemDefinition

PrimarySlotIndex

Gets the primary slot index.

public int PrimarySlotIndex { get; }

Property Value

int

Quantity

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

public int Quantity { get; }

Property Value

int

SecondarySlotIndex

Gets the secondary slot index.

public int SecondarySlotIndex { get; }

Property Value

int