Add event handler methods to the engine structure
This commit is contained in:
parent
c32a452f17
commit
9905ffd26b
5 changed files with 29 additions and 25 deletions
|
|
@ -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>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue