Add event handler methods to the engine structure

This commit is contained in:
reo 2025-09-18 00:32:12 +03:00
parent c32a452f17
commit 9905ffd26b
5 changed files with 29 additions and 25 deletions

View file

@ -18,6 +18,7 @@ pub trait System {
fn initialize(&mut self) {}
/// Spawn the first entities of the world.
fn load_world(&mut self, _ctx: &mut SystemContext) {}
fn handle_event(&mut self, _ctx: &mut SystemContext) {}
fn update(&mut self, _ctx: &mut SystemContext) {}
}
@ -40,4 +41,4 @@ impl SystemManager {
pub fn remove<S: 'static>(&mut self) {
self.systems.shift_remove(&TypeId::of::<S>());
}
}
}