Trait rinecs::component::Component [−][src]
pub trait Component: 'static + Sized { type Storage; type MutStorageCacheGuard: CacheConstructor; fn type_name() -> &'static str; fn is_reference() -> bool; fn id() -> Id { ... } fn references_other() -> Option<Box<dyn Fn(&Storages, &Entity) -> Entity>> { ... } }
Main Component trait.
Usually implemented using a derive attribute as in:
#[derive(Component, Debug)] struct Position{}
Allows to add a type as an entity’s component.