data/predicates/
A named predicate: a condition or number written once and reused by name. Other entries refer to it with Ref("<key>") wherever a condition or number goes, and it is inlined when they compile, so it costs nothing at run time. Its context is checked where it is used.
| Registry | manifold:predicate |
| Files | data/predicates/*.ron, *.update.ron, *.final.ron |
| Sides | both: the server and every client load it, and the handshake’s data hash covers it |
| Reads | nothing |
| Contract | Gameplay framework, data stage |
Entry
An entry is one of these forms, each written with its name:
| Variant | Written | Description |
|---|---|---|
Condition | Condition(id: .., when: ..) | A named condition, used as Ref("<key>") where a condition goes. |
Number | Number(id: .., value: ..) | A named number, used as Ref("<key>") where a number goes. |
Condition fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The predicate’s key, <mod-id>:<name>. | |
when | condition | yes | The condition. |
Number fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The predicate’s key, <mod-id>:<name>. | |
value | number | yes | The number. |
Example
No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/predicates/health.ron, which the data stage loads in its tests:
Number(id: "dataref-fixture:half_max_health",
value: "q.stat('this', 'manifold:max_health') / 2")