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 { type Error = ();

fn build(
    self,
    _world: &mut World,
    dispatcher_builder: DispatcherBuilder<'a, 'b>
) -> Result<DispatcherBuilder<'a, 'b>, ()> {
    if self.config {
        Ok(dispatcher_builder)
    } 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);

} ```