- 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".
18 lines
718 B
Rust
18 lines
718 B
Rust
use std::cell::RefCell;
|
|
use std::rc::Rc;
|
|
use crate::DebugUIBuffer;
|
|
use crate::scene::Scene;
|
|
|
|
pub trait EngineTrait {
|
|
type PlatformCtx: Clone;
|
|
fn new() -> Self;
|
|
fn initialize(&mut self, platform_context: Self::PlatformCtx);
|
|
fn frame_update(&mut self, platform_context: Self::PlatformCtx);
|
|
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 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 Self::Scene, &DebugUIBuffer);
|
|
}
|