Skip to content

📦 Stacks

Defines runtime item value types used throughout the Inventory system.

This folder contains the data structures that represent items at runtime.


🎯 Purpose

Define how items exist in containers, including quantity, durability, and metadata.


🧩 What Lives Here

  • ItemStack → runtime item stack
  • ItemMetaEntry → metadata key/value pair

⚠️ Important Notes

  • These types represent runtime values only
  • They do not enforce container rules or mutation logic
  • They are used across containers, services, and UI

🧠 Usage Guidance

ItemStack

Represents a quantity of a specific item.

Includes:

  • item definition reference
  • quantity
  • durability
  • optional metadata

Behaviour

stack.IsEmpty;
stack.SpaceLeft;
stack.Clone();
stack.WithQuantityDeep(q);
  • empty state is based on definition and quantity
  • space remaining is derived from stack limits
  • quantity is not automatically clamped

Metadata

Metadata is stored as key/value pairs.

  • entries are unordered
  • later entries may override earlier ones

Helpers include:

  • TryGetMeta
  • SetMeta
  • RemoveMeta

Stack compatibility

Compatibility checks may consider:

  • item definition
  • durability
  • metadata

Exact comparison behaviour depends on runtime implementation.


🚫 Not for Production Use

This folder does not:

  • Provide container storage
  • Define slot structures
  • Enforce mutation rules
  • Enforce authority
  • Define sorting or search behaviour

  • ../
  • ../Model/README.md
  • ../../Containers/README.md