docs
Systems
Contracts
ContractsSystem
ContractsSystem Overview

The Contracts System defines the shared vocabulary that SaffronLibrary systems use to communicate. It provides string keys, typed parameter keys, and the Domain enum that identifies which system owns a message.

Purpose in SaffronLibrary

This system lives under _Core/Contracts/ContractsSystem in the SaffronLibrary.Prime.Systems.Contracts namespace. It holds no runtime behavior of its own. Other systems reference it so they agree on key names, payload types, and target domains.

Key Responsibilities

  • Key naming: CoreKeyNames builds every parameter key string from a shared core.contracts base and a schema suffix, so key names stay consistent.
  • Typed parameter keys: CoreParamKeys exposes ParamKey<T> instances for strings, integers, Transform, GameObject lists, float durations, Domain values, and boxed object values.
  • Domain routing identifiers: The Domain enum lists 24 system domains (from UI through Companion) that messages can target.

Who Should Use This

  • Gameplay and feature developers who publish or consume parameter payloads between systems.
  • Developers adding a new system that needs its own Domain value or new shared keys.
  • Anyone reviewing cross-system communication contracts.