Trait System

Source
pub trait System {
    type Components: ComponentManager;
    type Services: ServiceManager;

    // Provided methods
    fn activated(
        &mut self,
        _: &EntityData<'_, Self::Components>,
        _: &Self::Components,
        _: &mut Self::Services,
    ) { ... }
    fn reactivated(
        &mut self,
        e: &EntityData<'_, Self::Components>,
        c: &Self::Components,
        s: &mut Self::Services,
    ) { ... }
    fn deactivated(
        &mut self,
        _: &EntityData<'_, Self::Components>,
        _: &Self::Components,
        _: &mut Self::Services,
    ) { ... }
}
Expand description

Generic base system type.

Required Associated Types§

Provided Methods§

Source

fn activated( &mut self, _: &EntityData<'_, Self::Components>, _: &Self::Components, _: &mut Self::Services, )

Optional method called when an entity is activated.

Source

fn reactivated( &mut self, e: &EntityData<'_, Self::Components>, c: &Self::Components, s: &mut Self::Services, )

Optional method called when an entity is reactivated.

By default it calls deactivated() followed by activated()

Source

fn deactivated( &mut self, _: &EntityData<'_, Self::Components>, _: &Self::Components, _: &mut Self::Services, )

Optional method called when an entity is deactivated.

Implementors§