specs_bundler
specs component and system bundler
= "0.4"
extern crate specs;
extern crate specs_bundler;
use ;
use ;
specs component and system bundler
specs_bundler = "0.4"
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 Options = ();
type Error = ();
fn build(
self,
_world: &mut World,
dispatcher_builder: DispatcherBuilder<'a, 'b>,
options: Self::Options,
) -> 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);
}