pub struct Guard {
pub requires_flags: Vec<FlagId>,
pub forbids_flags: Vec<FlagId>,
pub requires_state: Vec<StateCompare>,
}Expand description
The condition under which an effect fires, as one object.
The three axes of crate::gate::Gate in their declared form: the flags that
must be set, the flags that must not be, and the numeric comparisons that must
hold. Declared once and carried by QuestEffect::when, so every verb is
gatable on exactly the same terms and a fourth axis is one field here.
Fields§
§requires_flags: Vec<FlagId>Flags that must ALL be set (per party) for the effect to fire. Emission
wraps the effect’s commands in execute if score #party dw.f_<flag> matches 1.
forbids_flags: Vec<FlagId>Flags whose being set SUPPRESSES the effect — the dual of requires_flags,
emitted as execute unless score #party dw.f_<flag> matches 1.
requires_state: Vec<StateCompare>Numeric comparisons that must ALL hold (spec-0031), emitted as
execute if score <holder> dw.s_<state> matches <range>.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Guard
impl<'de> Deserialize<'de> for Guard
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Guard
impl JsonSchema for Guard
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more