1use std::path::PathBuf;
2
3pub type EntityId = u64;
5
6pub trait ObjectSystem {
8 fn create_root(&self, name: String, script_path: Option<PathBuf>) -> EntityId;
10
11 fn create_child(&self, name: String, script_path: Option<PathBuf>, parent: EntityId) -> Option<EntityId>;
14
15 fn remove(&self, id: EntityId);
17}
18
19pub trait WorldContext {
21 fn objects(&self) -> &dyn ObjectSystem;
23
24 fn log(&self, msg: &str);
26}
27
28pub trait Script: Send {
29 fn init(&mut self, ctx: &dyn WorldContext);
30 fn update(&mut self, ctx: &dyn WorldContext, delta: f32);
31}