Trait EntityBehaviourManager

Source
pub trait EntityBehaviourManager:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn add_behaviours(&self, entity_instance: ReactiveEntity);
    fn add_behaviour(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    );
    fn remove_behaviour(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    );
    fn remove_behaviours(&self, entity_instance: ReactiveEntity);
    fn remove_behaviours_by_id(&self, id: &Uuid);
    fn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId);
    fn has(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    ) -> bool;
    fn get_all(&self, entity_instance: ReactiveEntity) -> Vec<BehaviourTypeId>;
    fn get_instances_by_behaviour(
        &self,
        ty: &BehaviourTypeId,
    ) -> Vec<ReactiveEntity>;
    fn connect(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
    fn disconnect(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
    fn reconnect(
        &self,
        entity_instance: ReactiveEntity,
        behaviour_ty: &BehaviourTypeId,
    ) -> Result<(), BehaviourTransitionError>;
}

Required Methods§

Source

fn add_behaviours(&self, entity_instance: ReactiveEntity)

Adds all behaviours to the given reactive entity instance.

Source

fn add_behaviour( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, )

Creates and adds the given behaviour to the given reactive entity instance.

Source

fn remove_behaviour( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, )

Removes the given behaviour from the given reactive entity instance.

Source

fn remove_behaviours(&self, entity_instance: ReactiveEntity)

Removes all behaviours from the given reactive entity instance.

Source

fn remove_behaviours_by_id(&self, id: &Uuid)

Removes all behaviours from the reactive entity instance with the given id.

Source

fn remove_behaviours_by_behaviour(&self, behaviour_ty: &BehaviourTypeId)

Removes all behaviours of the given behaviour type.

Source

fn has( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, ) -> bool

Returns true, if the entity instance has the given behaviour.

Source

fn get_all(&self, entity_instance: ReactiveEntity) -> Vec<BehaviourTypeId>

Returns the behaviours of the given entity instance.

Source

fn get_instances_by_behaviour( &self, ty: &BehaviourTypeId, ) -> Vec<ReactiveEntity>

Returns the entity instances with the given behaviour.

Source

fn connect( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Connect

Source

fn disconnect( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Disconnect

Source

fn reconnect( &self, entity_instance: ReactiveEntity, behaviour_ty: &BehaviourTypeId, ) -> Result<(), BehaviourTransitionError>

Reconnect

Trait Implementations§

Source§

impl Injectable for dyn EntityBehaviourManager + Sync + Send

Implementors§