1use crate::object::Object;
2use crate::Result;
3
4pub trait Named {
6 fn name(&self) -> Option<String>;
7 fn set_name(&self, name: &str) -> Result<()>;
8}
9
10pub trait Component {}
12
13pub trait ObjectContainerComponent: Component {
15 fn count(&self) -> usize;
16 fn object_at(&self, index: usize) -> Option<Object>;
17
18 fn objects(&self) -> Vec<Object> {
19 (0..self.count())
20 .filter_map(|index| self.object_at(index))
21 .collect()
22 }
23
24 fn add_object(&self, object: &Object);
25 fn remove_object(&self, object: &Object);
26}
27
28pub trait JointAnimation {}