Development ⚠️ GridPlacement 6.0 documentation is in active development. APIs and content may change, and the site may be temporarily unstable.

GridPlacementInventory (Demo) Integration

Purpose

GridPlacementInventory is a demo-focused inventory layer that exists to make GridPlacement tutorials and example projects easier to follow.

It is intentionally small and not intended to be your production inventory system.

What this guide covers

  • How demo inventory typically plugs into placement rules / build actions.
  • What behaviors you can rely on for demos.
  • The recommended replacement path for production projects.

When to use GridPlacementInventory

Use it when:

  • You are working through tutorials.
  • You want a minimal “materials container” to validate and spend costs.
  • You are prototyping UI around a simple list/stack model.

Avoid it when:

  • You need persistence/save/load.
  • You need multiple inventories per player/character.
  • You need equipment, crafting, banking, or complex filtering/sorting.

Typical demo integration pattern

In demos, placement typically needs a way to:

  • Check if the player has enough items (materials).
  • Spend items when a build is committed.
  • Update UI when inventory changes.

A simple high-level pattern:

  1. Placement preview

    • Your placement validation checks inventory counts.
    • The indicator/UI can show “missing materials”.
  2. Commit build

    • On successful placement, inventory removes/spends required quantities.
  3. UI refresh

    • Inventory emits signals/events when contents change.

Minimal contract (demo)

Treat the API surface as intentionally small.

From the GridPlacementInventory demo service layer, demos typically rely on:

  • Add/remove items
  • Query counts
  • Receive change notifications

If you find yourself extending the demo inventory heavily, that’s a signal you should switch to a real inventory system.

Production recommendation

For production projects:

  • Use a real inventory system such as ItemVault.
  • Keep GridPlacement integration stable by writing a small adapter that provides:
    • HasCost(...)
    • SpendCost(...)
    • change notifications for UI

This keeps your placement logic independent of the specific inventory implementation.

  • GridPlacementInventory README (demo scope and API notes)
  • External integration guide (service boundaries and adapters)