Implemented commands on scopes

This commit is contained in:
2026-01-28 19:33:12 +01:00
parent 715175c412
commit 63abf41094
4 changed files with 26 additions and 17 deletions
+9 -1
View File
@@ -4,7 +4,7 @@ pub mod console;
pub use benchmark::*;
pub use console::*;
use std::sync::Arc;
use std::{any::Any, sync::Arc};
use crate::{prelude::Context, render::Area, DrawContext, View};
@@ -30,3 +30,11 @@ pub trait Engine {
fn render_view(&self, area: &Area, view: &View) -> DrawContext;
fn draw_context(&self, ctx: &DrawContext);
}
pub trait Command {
fn as_any(&self) -> &dyn Any;
}
pub trait CommandExecutor {
fn execute_command(&self, command: &Arc<dyn Command>) -> crate::Result<()>;
}