Trait EntityComponentBehaviourRegistry

Source
pub trait EntityComponentBehaviourRegistry:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn register(
        &self,
        component_behaviour_ty: ComponentBehaviourTypeId,
        factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
    );
    fn unregister(&self, component_behaviour_ty: &ComponentBehaviourTypeId);
    fn get_all(&self) -> Vec<ComponentBehaviourTypeId>;
    fn get(
        &self,
        component_ty: &ComponentTypeId,
    ) -> Vec<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>;
    fn get_behaviour_types(
        &self,
        component_ty: &ComponentTypeId,
    ) -> Vec<ComponentBehaviourTypeId>;
    fn get_by_behaviour_type(
        &self,
        behaviour_ty: &BehaviourTypeId,
    ) -> Option<ComponentBehaviourTypeId>;
    fn count(&self) -> usize;
}

Required Methods§

Source

fn register( &self, component_behaviour_ty: ComponentBehaviourTypeId, factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>, )

Registers a factory for creating entity component behaviours.

Source

fn unregister(&self, component_behaviour_ty: &ComponentBehaviourTypeId)

Unregisters a factory for creating entity component behaviours.

Source

fn get_all(&self) -> Vec<ComponentBehaviourTypeId>

Returns all entity component behaviours.

Source

fn get( &self, component_ty: &ComponentTypeId, ) -> Vec<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>

Returns the entity behaviour factories for the given component type.

Source

fn get_behaviour_types( &self, component_ty: &ComponentTypeId, ) -> Vec<ComponentBehaviourTypeId>

Returns the component behaviours for the given component type.

Source

fn get_by_behaviour_type( &self, behaviour_ty: &BehaviourTypeId, ) -> Option<ComponentBehaviourTypeId>

Returns the entity behaviour for the given behaviour type if the entity component behaviour exists.

Source

fn count(&self) -> usize

Returns the count of entity component behaviours.

Trait Implementations§

Implementors§