Trait EntityBehaviourRegistry

Source
pub trait EntityBehaviourRegistry:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn register(
        &self,
        entity_behaviour_ty: EntityBehaviourTypeId,
        factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
    );
    fn unregister(&self, entity_behaviour_ty: &EntityBehaviourTypeId);
    fn get_all(&self) -> Vec<EntityBehaviourTypeId>;
    fn get(
        &self,
        entity_ty: &EntityTypeId,
    ) -> Vec<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>;
    fn get_factory_by_behaviour_type(
        &self,
        behaviour_ty: &BehaviourTypeId,
    ) -> Option<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>;
    fn get_behaviour_types(
        &self,
        entity_ty: &EntityTypeId,
    ) -> Vec<EntityBehaviourTypeId>;
    fn get_by_behaviour_type(
        &self,
        behaviour_ty: &BehaviourTypeId,
    ) -> Option<EntityBehaviourTypeId>;
    fn count(&self) -> usize;
}

Required Methods§

Source

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

Registers a factory for creating entity behaviours.

Source

fn unregister(&self, entity_behaviour_ty: &EntityBehaviourTypeId)

Unregisters a factory for creating entity behaviours.

Source

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

Returns all entity behaviours.

Source

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

Returns the entity behaviour factories for the given entity type.

Source

fn get_factory_by_behaviour_type( &self, behaviour_ty: &BehaviourTypeId, ) -> Option<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>

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

Source

fn get_behaviour_types( &self, entity_ty: &EntityTypeId, ) -> Vec<EntityBehaviourTypeId>

Returns the entity behaviours for the given entity type.

Source

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

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

Source

fn count(&self) -> usize

Returns the count of entity behaviours.

Trait Implementations§

Source§

impl Injectable for dyn EntityBehaviourRegistry + Sync + Send

Implementors§