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

@ -56,6 +56,18 @@ impl EngineTrait for Engine {
}
}
fn handle_event(&mut self, platform_context: PlatformContext) {
let mut ctx = SystemContext {
scene: self.scene_manager.current_mut(),
platform_context,
debug_ui_buffer: self.debug_ui_buffer.clone(),
};
for system in self.system_manager.systems.values_mut() {
system.handle_event(&mut ctx);
}
}
// pub fn build_system_context(&mut self) -> SystemContext {
// SystemContext {
// scene: self.scene_manager.current_mut(),