⚙️ Crafting — UnityIntegration / CraftingService¶
📦 Folder Overview¶
This page documents the Unity-facing runtime service for Crafting.
CraftingService orchestrates crafting at runtime, including preflight checks,
acceptance, job management, delivery, failure handling, persistence, and events.
🧩 What Lives Here¶
CraftingService— primary runtime entry point- integration with adapters, authority, routing, time, and RNG
- Unity-facing events and queries
🎯 Purpose¶
CraftingService provides a Unity runtime host that:
- evaluates crafting requests
- consumes inputs and currency at acceptance
- manages queued and running jobs
- delivers outputs immediately or on completion
- exposes runtime state and events
It integrates with optional systems via abstractions rather than implementing them.
🧠 Usage Guidance¶
Common Entry Points¶
CanCraft/CanCraftDetailed— preflight checksEnqueue— create crafting workGetJobs— inspect runtime stateSaveActiveJobs/RestoreJobs— persistence
Runtime Model¶
The crafting pipeline is staged:
- preflight
- acceptance
- job execution
- delivery
- completion or failure
Acceptance and delivery are separate phases. Failures may occur after inputs or currency have been consumed. Recovery depends on adapter behaviour.
⚙️ Dependencies¶
Required¶
ICraftingInventoryAdapter
Optional¶
ICraftingCurrencyAdapterICraftingAuthorityICraftingOutputRouterIRandomProviderITimeProviderIWallClockProvider
Fallback behaviour is applied where supported.
⚠️ Important Notes¶
- service owns runtime orchestration
- behaviour depends on configured adapters and settings
- failure and refund handling are adapter-dependent
🚫 Not for Production Use¶
This service does not implement:
- inventory or currency systems
- UI frameworks
- networking or replication
These are integrated via abstractions.
🔗 Related Documentation¶
- Crafting Core (pure runtime logic)
- Crafting Contracts (data structures)
- Crafting Modifiers / Validators / Routing (extension seams)
🧠 Design Notes¶
- service-driven orchestration
- staged execution model
- adapter-based integration
This component is the primary runtime interface for Crafting within Unity.