pub trait ComponentTrait: Debug {
    // Required methods
    fn get_type() -> ComponentType;
    fn from_entity(handle: Entity) -> Self;
    fn entity(&self) -> Entity;
}
Expand description

Common interface that components expose.

Required Methods§

source

fn get_type() -> ComponentType

The type of the component, as a ComponentType enum.

source

fn from_entity(handle: Entity) -> Self

Adopt an Entity, wrap in a component struct.

source

fn entity(&self) -> Entity

Get the entity that the component belongs to.

Implementors§