The QuerySystem provides a typed way to ask the system that owns a Domain for data, without changing any state. Callers build a Query addressed to a Domain, send it through the message bus, and read the answer from the query's result.
The system exists so that any part of SaffronLibrary can read data owned by another system (platform, level time, current level, game speed) without referencing that system directly. Each query carries a target Domain, a QueryVerb, input Params describing what is asked, and result Params filled in by the handling system.
Key responsibilities:
- Define the query message.
Queryand theIQuerycontract carry the target domain, verb, input params, result params, and status. - Define query vocabulary.
QueryVerb,QueryStatus, andQuerySubjectsdescribe what is asked, the outcome, and the subject being asked about. - Provide typed access helpers.
QueryKeysandQueryKeyNamesdefine the param keys, andQueryFactorybuilds and sends the shared queries and returns their typed values.
Who should use it: gameplay and UI developers who need read-only data from another domain, and developers adding new query subjects or handlers in an owning system.
Dependencies (connections only):
- Contracts supplies the
Domainenum that routes each query. - Params supplies the typed
ParamKeyandParamscontainers that carry query data. - Bus supplies the
QueryBusandBusUtilitythat deliver queries, and the message bus base that queues them.