2022-08-14 14:20:22 +00:00
|
|
|
use common::resources::{Time, TimeOfDay};
|
2022-08-11 14:44:57 +00:00
|
|
|
use world::{World, IndexRef};
|
|
|
|
use super::{Rule, RtState};
|
2022-08-09 23:02:56 +00:00
|
|
|
|
|
|
|
pub trait Event: Clone + 'static {}
|
|
|
|
|
2022-08-11 14:44:57 +00:00
|
|
|
pub struct EventCtx<'a, R: Rule, E: Event> {
|
|
|
|
pub state: &'a RtState,
|
|
|
|
pub rule: &'a mut R,
|
|
|
|
pub event: &'a E,
|
|
|
|
pub world: &'a World,
|
|
|
|
pub index: IndexRef<'a>,
|
|
|
|
}
|
|
|
|
|
2022-08-09 23:02:56 +00:00
|
|
|
#[derive(Clone)]
|
2022-08-11 14:44:57 +00:00
|
|
|
pub struct OnSetup;
|
|
|
|
impl Event for OnSetup {}
|
2022-08-09 23:02:56 +00:00
|
|
|
|
2022-08-11 14:44:57 +00:00
|
|
|
#[derive(Clone)]
|
2022-08-11 20:54:35 +00:00
|
|
|
pub struct OnTick {
|
2022-08-14 14:20:22 +00:00
|
|
|
pub time_of_day: TimeOfDay,
|
|
|
|
pub time: Time,
|
2022-08-11 20:54:35 +00:00
|
|
|
pub dt: f32,
|
|
|
|
}
|
2022-08-09 23:02:56 +00:00
|
|
|
impl Event for OnTick {}
|