pub struct EffectState<P: EffectProvider + ?Sized> {
pub id: EffectId,
pub host: BattlerRef,
pub effect_order: u64,
pub kind: P::EffectStateKind,
}Expand description
One live effect’s mutable per-instance state, held in an arena keyed by id
(design §3.1). kind is the game’s typed counter enum, so the compiler
checks every counter (no positional slot bag).
Fields§
§id: EffectIdThe effect id (arena key; the arena is kept sorted for binary search).
host: BattlerRefThe battler this effect is attached to.
Kept BattlerRef (not EffectHost) so every existing struct-literal
constructor compiles unchanged (see EffectHost’s non-breaking note).
Project to the 3-way scope via EffectState::host_scope.
effect_order: u64Monotonic creation counter — the final deterministic tiebreak in the comparator (design §1.3), stamped at creation, consumes NO rng.
kind: P::EffectStateKindThe game’s typed counter state.
Implementations§
Source§impl<P: EffectProvider + ?Sized> EffectState<P>
impl<P: EffectProvider + ?Sized> EffectState<P>
Sourcepub fn host_scope(&self) -> EffectHost
pub fn host_scope(&self) -> EffectHost
The 3-way host scope of this effect (design §3.1). Arena effects are
always battler-hosted today, so this returns EffectHost::Battler; the
method is the routing seam the driver uses so a future side/field-hosted
state path can branch on scope without callers caring how host is
stored.