Skip to content

⚙️ 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 checks
  • Enqueue — create crafting work
  • GetJobs — inspect runtime state
  • SaveActiveJobs / RestoreJobs — persistence

Runtime Model

The crafting pipeline is staged:

  1. preflight
  2. acceptance
  3. job execution
  4. delivery
  5. 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

  • ICraftingCurrencyAdapter
  • ICraftingAuthority
  • ICraftingOutputRouter
  • IRandomProvider
  • ITimeProvider
  • IWallClockProvider

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.


  • 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.