docs
Systems
Contracts
ContractsSystem
Key Components

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 CoreParamKeys fields. It sets DomainContext to a Domain value when the message has a target.
  • A consumer reads the same fields to retrieve typed values.
  • Both sides rely on CoreKeyNames through CoreParamKeys. Changing a key string in CoreKeyNames changes the key for every consumer.

Dependencies

  • ParamKey<T> from SaffronLibrary.Prime.Systems.Param.Interfaces. Every CoreParamKeys field is an instance of this type.
  • Unity types Transform, GameObject, and List<T> are used as payload types.