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<&impl Object>) -> Option<&impl Object>;
12
13 fn remove_object(&mut self, object: &impl Object) -> bool;
15
16 fn set_object_script(&mut self, object: &impl Object, script_path: Option<PathBuf>) -> bool;
19
20 fn move_object_to_parent(&mut self, child_object: &impl Object, new_parent: Option<&impl Object>) -> bool;
23
24 fn get_object(&self, object_path: &str) -> Option<&impl Object>;
26
27 fn add_component(&mut self, object: &impl Object, component: Box<impl crate::ComponentData>);
29
30 fn log(&self, msg: &str);
32}