Trait planck_ecs_bundle::Bundle [−][src]
pub trait Bundle { fn systems() -> Vec<System>; fn insert(builder: DispatcherBuilder) -> DispatcherBuilder { ... } }
Expand description
A trait allowing the creation of bundles.
Bundles are groups of System
s that are added together and
in order in a DispatcherBuilder
.
Example
use world_dispatcher::*; use planck_ecs_bundle::*; struct TestBundle; impl Bundle for TestBundle { fn systems() -> Vec<System> { vec![ (|| {Ok(())}).system(), (|| {Ok(())}).system(), (|| {println!("hello!"); Ok(())}).system(), ] } } let mut builder = DispatcherBuilder::default(); #[allow(unused_assignments)] { builder = TestBundle::insert(builder); }
Required methods
fn systems() -> Vec<System>
[src]
Expand description
Returns all the systems of this bundle. This should normally be the only function you need to implement.
Provided methods
fn insert(builder: DispatcherBuilder) -> DispatcherBuilder
[src]
Expand description
Inserts the systems of this bundle into the provided DispatcherBuilder
.
A default implementation is already provided for you.