Skip to content

Crafting — Core / Contracts

Folder Overview

This folder contains the public data contracts used to interact with the Crafting system.

Types in this folder are:

  • stable
  • serializable where appropriate
  • safe for external consumption
  • free of side effects and service logic

They define what callers can request, what the service reports, and how results are described, without exposing internal implementation details.


What Lives Here

Requests

  • CraftRequest Input parameters for enqueueing crafts. Supports single or batched execution and captures owner, recipe, count, container override, station tag, and user data.

Preflight Results

  • CraftCheck Result of a detailed preflight evaluation. Reports maximum craft count and blocking reason.

  • CraftProbe Breakdown of preflight limits for UI and tooling (items, currency, space).

These types describe capability, not execution.


Jobs & Persistence

  • CraftJob Runtime record of an accepted craft or batch. Read-only to consumers.

  • CraftJobSnapshot Serializable snapshot used for save/load and offline progress.

  • CraftJobState Discrete job states (Queued, Running, Paused, Completed, Cancelled, Failed).


Enums & Configuration

  • CraftFailReason Explicit reasons a craft cannot proceed. Used across preflight, runtime, and events.

  • CraftTimeMode Declares which time source the service uses.

  • CraftPreflightOptions Optional overrides for container and station context during preflight.


Purpose

These contracts provide a stable boundary for:

  • requesting crafting operations
  • inspecting preflight capability
  • observing job state and lifecycle
  • persisting and restoring crafting progress

They allow interaction with the Crafting system without exposing internal behaviour.


Usage Guidance

Callers

  • treat contract types as descriptive, not authoritative
  • do not rely on internal ordering or timing
  • use CraftFailReason for UI and feedback

Persistence

  • use CraftJobSnapshot for save/load
  • provide ID mapping for owners and recipes
  • snapshots represent already-accepted jobs

Important Notes

  • contracts do not perform behaviour or side effects
  • behaviour is defined by the Crafting service
  • fields may be extended without breaking existing usage

Not for Production Use

This folder defines contracts, not the code behind them

This folder does not include:

  • service logic
  • adapter interfaces
  • validation or modifier behaviour

  • Crafting Core (runtime behaviour)
  • Crafting Context (data flow through evaluation)

Public API

All types in this folder are part of the supported Crafting API surface.

They are intended for use by:

  • gameplay code
  • UI layers
  • teaching tools
  • external integrations

Design Notes

  • data-focused types
  • no service logic or side effects
  • suitable for serialization and inspection

If behaviour is required, it belongs in the service or integration layers.