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:
CoreKeyNamesbuilds every parameter key string from a sharedcore.contractsbase and a schema suffix, so key names stay consistent. - Typed parameter keys:
CoreParamKeysexposesParamKey<T>instances for strings, integers,Transform,GameObjectlists,floatdurations,Domainvalues, and boxed object values. - Domain routing identifiers: The
Domainenum lists 24 system domains (fromUIthroughCompanion) 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
Domainvalue or new shared keys. - Anyone reviewing cross-system communication contracts.