pub enum GateConsumer {
Objective,
Effect,
Trigger,
Trap,
DialogueOption,
CastPlacement,
ShopOffer,
}Expand description
The object classes that carry a gate. A closed set.
ALL is the enumeration; GateConsumer::label and every consumer that
matches on one is exhaustive, so an eighth class is a compile error at every
site where the answer would have to change.
Variants§
Objective
A stage-5 quests[].objectives[] — the gate decides whether the
objective activates.
Effect
Any QuestEffect, at any of the five effect roots, top-level or nested —
the gate decides whether the effect’s commands run.
Trigger
A stage-5 triggers[] — the gate decides whether the trigger can fire.
Trap
A stage-5 traps[] — the gate decides whether the trap is armed.
DialogueOption
A stage-6 dialogues[].nodes[].options[] — the gate decides whether the
option is shown, and whether a direct /trigger on it does anything.
CastPlacement
A stage-5 quests[].cast[] placement — the gate decides which branch’s
scene describes the world.
ShopOffer
A stage-5 shops[].offers[] (DSL v0.10, spec-0032) — the gate decides
whether the button is shown, and whether a direct /trigger on it does
anything. This is where a price lives: a shop declares no comparison
surface of its own, because “may this happen yet?” already has an owner.
Implementations§
Source§impl GateConsumer
impl GateConsumer
Sourcepub const ALL: [GateConsumer; 7]
pub const ALL: [GateConsumer; 7]
Every consumer class, in enumeration order (= visit order in
for_each_gate).
Sourcepub fn evaluates_per_player(self) -> Option<bool>
pub fn evaluates_per_player(self) -> Option<bool>
Whether emission evaluates this consumer’s gate against an acting
player (@s) rather than against the party holder (#party) — or
None when the class alone cannot say.
This is a statement about the emitter, not a preference: a dialogue
option’s availability is computed per player into dw.dmask and its
/trigger handler runs as @s; a cast placement selects a scene into a
per-player dw.cast. Three of the others are party predicates by
construction — an objective’s activation guard is read on the tick
(“whoever finishes the last objective completes the quest for everyone”),
and a trigger’s and a trap’s arming gates flip one global sentinel.
Effect answers None, and that is the whole point of the return
type. An effect’s gate is evaluated wherever its bundle is run, and
which that is belongs to the root, not to the effect: four roots have
an acting player and three do not
(EffectRootKind::runs_with_acting_player),
and on top of that the sequence / on_arrive seams inside a bundle drop
the actor mid-walk. An earlier version of this method answered true for
Effect, which is right for on_objective_complete and wrong for a
trigger’s effects, a trap’s payload and a shortcut’s on_unlock — three
of the seven roots, silently. Option makes that wrong answer
unrepresentable: a caller must handle the deferral.
It is what makes a player-scoped datum’s readability decidable
(DW0503) from the closed consumer set rather than from a list somebody
maintains — an eighth consumer class must answer this to compile.
Trait Implementations§
Source§impl Clone for GateConsumer
impl Clone for GateConsumer
Source§fn clone(&self) -> GateConsumer
fn clone(&self) -> GateConsumer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more