pub struct CompiledHook {
pub id: EffectId,
pub event: Event,
pub order: u32,
pub priority: i32,
pub chance: Option<(u32, u32)>,
pub ops: Vec<Op>,
pub move_type_index: Option<usize>,
pub effect_type: EffectType,
pub source_id: String,
pub resolver: ResolverKind,
}Expand description
One compiled hook program (doc 11 §2): the closed op-list + its ordering +
the optional RNG gate. The driver / interpreter reads this by EffectId.
Fields§
§id: EffectIdThe synthesized id keying this hook (the engine threads it as
source_effect).
event: EventWhich closed event this hook fires on.
order: u32on<Event>Order; LOW first.
priority: i32on<Event>Priority; HIGH first.
chance: Option<(u32, u32)>Optional (num, den) RNG gate — drawn unconditionally so draw order is a
pure function of the op-list (doc 11 §4.1).
ops: Vec<Op>The interned, bound op-list (chart/stat/status names already validated to indices at compile).
move_type_index: Option<usize>The in-flight move type chart index for this effect (for ApplyTypeChart,
recovered from source_effect), if the record carried a type:.
effect_type: EffectTypeThe engine effect category (sub_order feed).
source_id: StringThe original effect id string (for tracing/diagnostics).
resolver: ResolverKindWhich resolver hosts the owning effect.
Trait Implementations§
Source§impl Clone for CompiledHook
impl Clone for CompiledHook
Source§fn clone(&self) -> CompiledHook
fn clone(&self) -> CompiledHook
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more