Overview
The Contracts System contains no manager, coordinator, handler, or listener classes. Its components are static definitions that other systems import.
Components
CoreKeyNames
Static class that holds the string constants for parameter keys. It has no state and no behavior. Its values are the source for every CoreParamKeys field.
CoreParamKeys
Static class that exposes typed ParamKey<T> fields. These are the keys a producer writes to and a consumer reads from in a parameter payload. Each field's type fixes the payload type for that key.
Key groups:
- Identity:
ID,IDs,Key,RegistrationKey - Labels and values:
Tag,StringValue,ObjectValue,Duration - Scene objects:
Transform,GameObjects - Routing:
DomainContext
Domain
Enum that identifies the owning system for a message. A producer sets CoreParamKeys.DomainContext to a Domain value to name the target.
Interactions
- A producer creates a payload and writes values with
CoreParamKeysfields. It setsDomainContextto aDomainvalue when the message has a target. - A consumer reads the same fields to retrieve typed values.
- Both sides rely on
CoreKeyNamesthroughCoreParamKeys. Changing a key string inCoreKeyNameschanges the key for every consumer.
Dependencies
ParamKey<T>fromSaffronLibrary.Prime.Systems.Param.Interfaces. EveryCoreParamKeysfield is an instance of this type.- Unity types
Transform,GameObject, andList<T>are used as payload types.