Skip to content
1.0 · DemoSample product content

Items and slots ​

Keep an item's definition separate from the quantity held in a slot. This makes both the implementation and its documentation easier to follow.

Core concepts ​

ConceptMeaningExample
Item IDA stable key for an item type.health_potion
Display nameThe text shown in the interface.Health Potion
QuantityThe number of items in a slot.3
Stack limitThe maximum quantity per slot.5
CapacityThe number of inventory slots.4

Adding items ​

In this example, the suggested workflow first checks matching stacks with available space. If quantity remains, it looks for empty slots. The result should clearly report when there is not enough space.

text
Validate the quantity
  → Find matching stacks
  → Check empty slots
  → Report the result
  → Update the view

Data and the interface ​

Inventory data represents the result of an operation. The interface displays that result. An icon appearing in a slot does not, on its own, prove that an item was successfully added to the data.

Design choice: partial additions ​

If there is room for only 3 out of 10 items, an implementation may add 3 or reject the entire operation. A real product guide should explain which behavior it uses, what result it returns, and what quantity remains in the world.

Return to the quick start to try the scenario again.

Multiple products. One knowledge base.