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§
Sourcefn register(
&self,
entity_behaviour_ty: EntityBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
)
fn register( &self, entity_behaviour_ty: EntityBehaviourTypeId, factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>, )
Registers a factory for creating entity behaviours.
Sourcefn unregister(&self, entity_behaviour_ty: &EntityBehaviourTypeId)
fn unregister(&self, entity_behaviour_ty: &EntityBehaviourTypeId)
Unregisters a factory for creating entity behaviours.
Sourcefn get(
&self,
entity_ty: &EntityTypeId,
) -> Vec<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>
fn get( &self, entity_ty: &EntityTypeId, ) -> Vec<Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>>
Returns the entity behaviour factories for the given entity type.
Sourcefn get_factory_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<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>>
Returns the entity behaviour for the given behaviour type if the entity behaviour exists.
Sourcefn get_behaviour_types(
&self,
entity_ty: &EntityTypeId,
) -> Vec<EntityBehaviourTypeId>
fn get_behaviour_types( &self, entity_ty: &EntityTypeId, ) -> Vec<EntityBehaviourTypeId>
Returns the entity behaviours for the given entity type.
Sourcefn get_by_behaviour_type(
&self,
behaviour_ty: &BehaviourTypeId,
) -> Option<EntityBehaviourTypeId>
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.