Trait tinyecs::System [] [src]

pub trait System {
    fn aspect(&self) -> Aspect;

    fn data_aspects(&self) -> Vec<Aspect> { ... }
    fn on_created(&mut self, _: &mut EntityManager) { ... }
    fn on_begin_frame(&mut self) { ... }
    fn on_added(&mut self, _: &mut Entity) { ... }
    fn on_removed(&self, _: &mut Entity) { ... }
    fn on_end_frame(&mut self) { ... }
    fn process_w(&mut self, _: &mut Entity, _: &mut WorldHandle) { ... }
    fn process_d(&mut self, _: &mut Entity, _: &mut DataList) { ... }
    fn process_wd(&mut self, _: &mut Entity, _: &mut WorldHandle, _: &mut DataList) { ... }
    fn process_one(&mut self, _: &mut Entity) { ... }
    fn process_all(&mut self, entities: &mut Vec<&mut Entity>, world: &mut WorldHandle, data: &mut DataList) { ... }
}

System traits

You can implement one of those processes, but if you implement process_all - only it will be called, and if you dont implement process_all - all process_* will be called.

Most common case - implement only process_one.

Required Methods

fn aspect(&self) -> Aspect

System will subscribe only on components, sutisfied by this aspect.

Provided Methods

fn data_aspects(&self) -> Vec<Aspect>

For each returned aspect, one additional entity pack DataList will be received. Strongly recomends use it only with registration macro.

fn on_created(&mut self, _: &mut EntityManager)

fn on_begin_frame(&mut self)

fn on_added(&mut self, _: &mut Entity)

fn on_removed(&self, _: &mut Entity)

fn on_end_frame(&mut self)

fn process_w(&mut self, _: &mut Entity, _: &mut WorldHandle)

fn process_d(&mut self, _: &mut Entity, _: &mut DataList)

fn process_wd(&mut self, _: &mut Entity, _: &mut WorldHandle, _: &mut DataList)

fn process_one(&mut self, _: &mut Entity)

fn process_all(&mut self, entities: &mut Vec<&mut Entity>, world: &mut WorldHandle, data: &mut DataList)

Implementors