use crate::{RunPhase, RuntimeTick};
#[doc = crate::_tags!(runtime time)]
#[doc = crate::_doc_location!("run/time")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct RunStep<'a, E = ()> {
tick: RuntimeTick,
phase: RunPhase,
events: &'a [E],
}
impl<'a, E> RunStep<'a, E> {
pub const fn new(tick: RuntimeTick, phase: RunPhase, events: &'a [E]) -> Self {
Self { tick, phase, events }
}
pub const fn tick(&self) -> RuntimeTick {
self.tick
}
pub const fn phase(&self) -> RunPhase {
self.phase
}
pub const fn events(&self) -> &'a [E] {
self.events
}
pub const fn is_running(&self) -> bool {
matches!(self.phase, RunPhase::Running)
}
}