specs_bundler

specs component and system bundler

toml specs_bundler = "0.2"

```rust extern crate specs; extern crate specs_bundler;

use specs::{DispatcherBuilder, World}; use specs_bundler::{SpecsBundler, SpecsBundle};

[derive(Default)]

struct Bundle { config: bool }

impl<'a, 'b> SpecsBundle<'a, 'b> for Bundle { fn build( self, world: &mut World, dispatcherbuilder: DispatcherBuilder<'a, 'b> ) -> specsbundler::Result> { if self.config { Ok(dispatcherbuilder) } else { Ok(dispatcher_builder) } } }

fn main() { let mut world = World::new();

let mut dispatcher = SpecsBundler::new(&mut world, DispatcherBuilder::new())
    .bundle(Bundle::default()).expect("should not be an error")
    .build();

dispatcher.dispatch(&mut world.res);

} ```