summaryrefslogtreecommitdiff
path: root/src/room.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-04-07 22:50:01 +0200
committertroido <troido@protonmail.com>2020-04-07 22:50:01 +0200
commit5bef1829e443985e960a3cb64106d3f2e3dbf420 (patch)
treee8c5d04bcfdc09c38c6595c4efb6acfd2e869c5d /src/room.rs
parent9d09670cb239ac9ed5d08a765b2b627b13121efe (diff)
removed view_dispatcher; just call those systems manually
Diffstat (limited to 'src/room.rs')
-rw-r--r--src/room.rs17
1 files changed, 7 insertions, 10 deletions
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);
}