summaryrefslogtreecommitdiff
path: root/src/room.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-24 12:38:23 +0100
committertroido <troido@protonmail.com>2020-02-24 12:38:23 +0100
commit715c9106dbff4524f3fdf5d23f762e5e6518e0cb (patch)
treecf5dc0c5d30fc9ba7e38bdff40907fe4a96261a2 /src/room.rs
parent4718cfdc7c2bf67d2389ca18ab035fe5a0887ff0 (diff)
healing works now too, the first time based system
Diffstat (limited to 'src/room.rs')
-rw-r--r--src/room.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/room.rs b/src/room.rs
index e19d689..3856cbd 100644
--- a/src/room.rs
+++ b/src/room.rs
@@ -21,7 +21,8 @@ use crate::{
NewEntities,
Spawn,
Players,
- Emigration
+ Emigration,
+ TimeStamp
},
systems::{
Move,
@@ -35,7 +36,8 @@ use crate::{
Use,
Attacking,
Trapping,
- Fight
+ Fight,
+ Heal
},
components::{
Position,
@@ -79,13 +81,14 @@ impl <'a, 'b>Room<'a, 'b> {
let mut dispatcher = DispatcherBuilder::new()
.with(RegisterNew::default(), "registernew", &[])
- .with(ControlInput, "controlinput", &[])
+ .with(ControlInput, "controlinput", &["registernew"])
.with(Take, "take", &["controlinput"])
.with(Use, "use", &["controlinput"])
.with(Move, "move", &["registernew", "controlinput"])
.with(Trapping, "trapping", &["move"])
.with(Fight, "fight", &["move", "controlinput"])
- .with(Attacking, "attacking", &["use", "trapping", "fight"])
+ .with(Heal, "heal", &["registernew"])
+ .with(Attacking, "attacking", &["use", "trapping", "fight", "heal"])
.with(View::default(), "view", &["move", "attacking"])
.with(Migrate, "migrate", &["view"])
.with(Create, "create", &["view", "controlinput"])
@@ -135,7 +138,8 @@ impl <'a, 'b>Room<'a, 'b> {
self.world.fetch::<Output>().output.clone()
}
- pub fn update(&mut self) {
+ pub fn update(&mut self, timestamp: i64) {
+ self.world.fetch_mut::<TimeStamp>().time = timestamp;
self.dispatcher.dispatch(&self.world);
self.world.maintain();
}