🔗 Crafting — Integrations¶
The Integrations folder contains optional runtime bridges, helpers, and Unity-facing components that let the Crafting system interoperate with other RevFramework modules (progression, inventory, currency, input, feedback, etc.) without introducing hard dependencies into the pure Crafting model.
These pieces are opt-in, replaceable, and intended to keep system coupling out of the core recipe/runtime data and contracts.
🎯 Purpose¶
Integrations exist so Crafting can plug into other systems without modifying the core recipe/runtime model.
They help keep:
- Crafting’s pure data/contracts free of hard dependencies on Inventory, Currency, or progression systems
- integration code thin and explicit
- optional systems removable or replaceable
- Unity-facing helper behaviour outside the pure runtime model
🧩 Optional progression seam¶
ICraftingLevelSource¶
ICraftingLevelSource is an optional capability interface used by validators
to expose a progression level (character, player, account, etc.).
Behaviour notes:
- Entirely opt-in — if no level source is present, level-gating validators do not block by default
- Implementations should be deterministic, allocation-free, and non-throwing
Samples or demo implementations may live outside this folder.
🔗 Adapter seams¶
Adapters are the main supported integration boundary between Crafting and other systems.
| Interface | Purpose |
|---|---|
ICraftingInventoryAdapter |
Connects Crafting to an inventory backend |
ICraftingInventoryReservationAdapter |
Optional strong/escrow inventory reservation seam |
ICraftingCurrencyAdapter |
Connects Crafting to a currency backend |
ICraftingCurrencyHoldAdapter |
Optional strong/escrow currency-hold seam |
ICraftingOutputRouter |
Optionally routes outputs to destination containers |
These adapters are designed for RevFramework systems.
They are not intended as a universal integration layer for third-party tools.
Projects can provide their own implementations of these interfaces.
Built-in adapters are provided for RevFramework systems only when the relevant modules are present.
👉 Custom or third-party integrations are not supported by these adapters.
If you are integrating external systems, implement your own adapter using the public interfaces.
🛡️ Bench authority helper¶
LocalBenchAuthority¶
- Convenience local (single-player) implementation of
ICraftingBenchAuthority - Always returns
true - Intended for bench/workbench code deciding whether enqueue should be attempted
Notes:
- This component is not consulted by
CraftingServicedirectly - Bench/workbench code decides whether to call enqueue
- Multiplayer/server-authoritative projects should replace it with a netcode-aware implementation
🧭 Workbenches¶
Workbenches are Unity-facing orchestration components, not part of the pure recipe/runtime model.
In the current layout they live under:
Integrations/Crafting/UnityIntegration/Workbenches
These components:
- resolve recipes through
RecipeResolve - use
CraftingServicefor preflight and enqueue - optionally use
ICraftingBenchAuthority - may depend on optional Unity-facing services such as input or feedback
They are optional and can be removed without affecting RecipeCore, RecipeResolve, or CraftingService.
⚙️ Script defines¶
Some integration pieces are conditionally compiled behind scripting defines:
| Define | Enables |
|---|---|
REV_INVENTORY_PRESENT |
Inventory adapter integration and Unity-facing recipe-wrapper conversion paths |
REV_CURRENCY_PRESENT |
Direct currency adapter integration |
REV_ECONOMY_PRESENT |
Economy-enabled currency adapter variant |
Notes:
- Crafting still works without these defines
- Optional adapters and Unity-facing integration helpers are excluded when their required systems are absent
- Economy-enabled currency adapters do not currently provide working hold/capture/release semantics unless explicitly documented otherwise
🧠 Integration guidelines¶
- Keep integration code thin and explicit
- Let Inventory / Currency / progression systems own their actual logic
- Use validators, modifiers, routers, and adapters rather than editing Crafting internals
- For multiplayer/server-authoritative projects, pair external authoritative systems with a suitable
ICraftingAuthorityimplementation and execute mutations on the authority side