Renderer functional

This commit is contained in:
2025-11-26 18:49:16 +01:00
parent 5ed483a09a
commit f959114327
6 changed files with 377 additions and 5 deletions
+4 -2
View File
@@ -1,7 +1,11 @@
pub mod entity;
pub mod renderer;
pub mod terminal;
use std::collections::HashMap;
use crate::renderer::Renderer;
pub fn init() -> Engine {
Engine {
threads: HashMap::new(),
@@ -14,8 +18,6 @@ pub struct Engine {
entities: Vec<entity::Entity>,
}
pub struct Renderer {}
impl Engine {
pub fn thread<F: FnMut() + Send + Sync + 'static>(&mut self, label: &str, f: F) {
self.threads.insert(label.to_string(), Box::new(f));