Replace contexts with resources
- Implements a new macro to generate code for a new structure: TypeMap - TypeMaps are wrappers for HashMaps that use TypeIDs as keys. - Refactor the entire codebase to use the new resource structures. - This commit is the first step towards getting rid of "god context objects everywhere".
This commit is contained in:
parent
6e42d94b44
commit
ef055a1bda
16 changed files with 287 additions and 93 deletions
|
|
@ -11,7 +11,8 @@ pub trait EngineTrait {
|
|||
fn fixed_update(&mut self, platform_context: Self::PlatformCtx);
|
||||
fn handle_event(&mut self, platform_context: Self::PlatformCtx);
|
||||
fn current_scene_mut(&mut self) -> &mut Scene;
|
||||
fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>>;
|
||||
fn current_scene(&self) -> &Scene;
|
||||
fn get_debug_ui_buffer(&self) -> &DebugUIBuffer;
|
||||
fn reset_debug_ui_buffer(&mut self);
|
||||
fn scene_and_debug_ui_buffer_mut(&mut self) -> (&mut Scene, Rc<RefCell<DebugUIBuffer>>);
|
||||
// fn scene_and_debug_ui_buffer_mut(&mut self) -> (&mut Self::Scene, &DebugUIBuffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue