diff options
| author | troido <troido@protonmail.com> | 2020-04-07 22:50:01 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-07 22:50:01 +0200 |
| commit | 5bef1829e443985e960a3cb64106d3f2e3dbf420 (patch) | |
| tree | e8c5d04bcfdc09c38c6595c4efb6acfd2e869c5d | |
| parent | 9d09670cb239ac9ed5d08a765b2b627b13121efe (diff) | |
removed view_dispatcher; just call those systems manually
| -rw-r--r-- | src/purgatory.rs | 4 | ||||
| -rw-r--r-- | src/room.rs | 17 |
2 files changed, 7 insertions, 14 deletions
diff --git a/src/purgatory.rs b/src/purgatory.rs index 2b5a731..12be7cc 100644 --- a/src/purgatory.rs +++ b/src/purgatory.rs @@ -12,8 +12,6 @@ use crate::{ systems::{ Move, ControlInput, - Remove, - Create, Volate, UpdateCooldowns, ControlAI, @@ -31,8 +29,6 @@ pub fn create_purgatory<'a, 'b>(encyclopedia: &Encyclopedia) -> Room<'a, 'b> { .with(ControlInput, "controlinput", &["cool_down"]) .with(ControlAI, "controlai", &["cool_down"]) .with(Move, "move", &["controlinput", "controlai"]) - .with(Create, "create", &["move", "volate"]) - .with(Remove, "remove", &["volate", "move"]) .build(); let mut room = Room::new(purgatory_id(), encyclopedia.clone(), dispatcher); room.load_from_template(&RoomTemplate::from_json(&json!({ diff --git a/src/room.rs b/src/room.rs index c2e635a..1bdb5b5 100644 --- a/src/room.rs +++ b/src/room.rs @@ -7,7 +7,8 @@ use specs::{ DispatcherBuilder, Dispatcher, Join, - Entity + Entity, + RunNow }; use crate::{ @@ -88,15 +89,12 @@ pub fn default_dispatcher<'a, 'b>() -> Dispatcher<'a, 'b> { .with(Die, "die", &["attacking"]) .with(DropLoot, "droploot", &["attacking"]) .with(Migrate, "migrate", &["move", "attacking", "volate", "die"]) - .with(Create, "create", &["migrate", "spawn", "droploot", "growth"]) - .with(Remove, "remove", &["migrate", "move", "droploot"]) .build() } pub struct Room<'a, 'b> { world: World, dispatcher: Dispatcher<'a, 'b>, - view_dispatcher: Dispatcher<'a, 'b>, pub id: RoomId, places: HashMap<String, Pos> } @@ -127,11 +125,6 @@ impl <'a, 'b>Room<'a, 'b> { Room { world, dispatcher, - view_dispatcher: DispatcherBuilder::new() - .with(RegisterNew, "registernew", &[]) - .with(View, "view", &["registernew"]) - .with(Clear, "clear", &["view"]) - .build(), id, places: HashMap::new() } @@ -173,8 +166,12 @@ impl <'a, 'b>Room<'a, 'b> { pub fn update(&mut self, timestamp: Timestamp) { self.world.fetch_mut::<Time>().time = timestamp; self.dispatcher.dispatch(&self.world); + Create.run_now(&self.world); + Remove.run_now(&self.world); self.world.maintain(); - self.view_dispatcher.dispatch(&self.world); + RegisterNew.run_now(&self.world); + View.run_now(&self.world); + Clear.run_now(&self.world); } |
