oxide_engine_api/
context.rs1use std::path::PathBuf;
2use crate::Object;
3
4pub trait Context {
6 fn create_object(&mut self, object_name: String, script_path: Option<PathBuf>, parent_object: Option<&dyn Object>) -> Option<&dyn Object>;
12
13 fn remove_object(&mut self, object: &dyn Object) -> bool;
15
16 fn set_object_script(&mut self, object: &dyn Object, script_path: Option<PathBuf>) -> bool;
19
20 fn move_object_to_parent(&mut self, child_object: &dyn Object, new_parent: Option<&dyn Object>) -> bool;
23
24 fn get_object(&self, object_path: &str) -> Option<&dyn Object>;
26
27 fn add_component(&mut self, object: &dyn Object, component: Box<dyn crate::ComponentData>);
29
30 fn log(&self, msg: &str);
32}