Crafting — Sample Adapters¶
This folder contains sample-only adapter implementations used by Crafting demo scenes.
🎯 Purpose¶
These scripts exist to:
- Provide minimal, working implementations of:
ICraftingInventoryAdapterICraftingCurrencyAdapter- Allow Crafting demos to run without requiring a full inventory or economy system
- Demonstrate the shape and expectations of the adapter contracts
They are intentionally simple so you can focus on how Crafting integrates, not on building a full backend.
⚠️ Important¶
These adapters are not part of the supported Crafting API.
They are:
- sample code only
- not required to use the Crafting system
- not supported as extension points
- not covered by API stability guarantees
All data is:
- stored in-memory only
- lost when the scene/session ends
❌ What These Are NOT¶
These adapters are not:
- production-ready inventory or currency systems
- persistent or saveable data models
- thread-safe or multiplayer-safe
- authoritative or validated systems
They intentionally do NOT implement:
- save/load or persistence
- authority or validation rules
- transaction history or auditing
- escrow / hold behaviour
- complex stacking, slots, or container rules
🧠 Behaviour Model (Simplified)¶
To keep the examples clear:
- Inventory uses simple item counts (no slots, no stacking rules)
- Capacity is total item units, not slot-based
- Currency is a simple balance per owner + currencyId
- Missing values are treated as zero / empty state
- Failures return false instead of throwing
This behaviour is deliberately naive and should not be copied directly into production.
🧪 Using These Samples¶
You can:
- Use them to quickly test Crafting in isolation
- Read them to understand how adapters are expected to behave
- Use them as a starting point for your own implementations
🏗️ Production Guidance¶
For real projects:
👉 Implement your own adapters backed by your actual inventory/economy systems
👉 Enforce your own rules (validation, authority, persistence, auditing)
👉 Treat these samples as reference only, not as a foundation
🔗 Relationship to Crafting¶
Crafting depends on adapters, but does not provide them.
That means:
- Crafting defines the contract
- Your project provides the implementation
- These samples simply demonstrate the minimum viable shape