pub struct FightClock { /* private fields */ }Implementations§
Source§impl FightClock
impl FightClock
Sourcepub fn set_now(&mut self, tick: u64)
pub fn set_now(&mut self, tick: u64)
Stamp the current tick. Called by the event handler before dispatch so
schedule resolves relative delays against the right base.
Sourcepub fn now(&self) -> u64
pub fn now(&self) -> u64
The tick the dispatch in progress is running at. OverlordLogic::pre_event
stamps it in every dispatch path, so a hook that needs the current tick
but does not take it as an argument (the stone triggers’ per-slot
cooldown) reads it from here rather than growing a parameter through
apply_success_hooks.
Sourcepub fn set_dispatch_origin(&mut self, origin: CombatEventOrigin)
pub fn set_dispatch_origin(&mut self, origin: CombatEventOrigin)
Arm the provenance every subsequent schedule inherits. Called by
OverlordLogic::pre_event with the dispatching event’s provenance and
reset to Core when the dispatch ends.
Sourcepub fn schedule(&mut self, event: OverlordEvent, delay_ticks: u64)
pub fn schedule(&mut self, event: OverlordEvent, delay_ticks: u64)
Schedule event to fire delay_ticks after the current tick.
Inside a non-Core dispatch the event is stamped with that provenance — the delayed half of the inheritance rule. Stamping only ever upgrades (Core is the ambient default), so an event that was already marked by its emitter, or by the result-level restamp, is never downgraded here.
Sourcepub fn set_heartbeat(&mut self, event: OverlordEvent, rate_ticks: u64)
pub fn set_heartbeat(&mut self, event: OverlordEvent, rate_ticks: u64)
Install (or replace) the recurring combat heartbeat. Fires immediately
on the next collection, then every rate_ticks.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Drop all pending events and the heartbeat. Called when a new fight is prepared so nothing from the previous fight leaks into it.
Sourcepub fn collect_due(&mut self, tick: u64) -> Vec<OverlordEvent>
pub fn collect_due(&mut self, tick: u64) -> Vec<OverlordEvent>
Drain everything due at tick: pending events in (due_tick, seq)
order, then the heartbeat if its interval elapsed.
Trait Implementations§
Source§impl Clone for FightClock
impl Clone for FightClock
Source§fn clone(&self) -> FightClock
fn clone(&self) -> FightClock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more