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 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.
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
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FightClock
impl Debug for FightClock
Source§impl Default for FightClock
impl Default for FightClock
Source§fn default() -> FightClock
fn default() -> FightClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FightClock
impl RefUnwindSafe for FightClock
impl Send for FightClock
impl Sync for FightClock
impl Unpin for FightClock
impl UnwindSafe for FightClock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].