summaryrefslogtreecommitdiff
path: root/src/systems/heal.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-04 19:47:00 +0100
committertroido <troido@protonmail.com>2020-03-04 19:47:00 +0100
commit022e439a6677b9865b7a3287dbd197d86266f8ef (patch)
tree00c8cd7c08fe29cf9f6652b0082f2b13617e426c /src/systems/heal.rs
parentf8364fb636a8e9276939ae8523966b038388e4ff (diff)
implemented growth
Diffstat (limited to 'src/systems/heal.rs')
-rw-r--r--src/systems/heal.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/systems/heal.rs b/src/systems/heal.rs
index 458bc17..34e67f4 100644
--- a/src/systems/heal.rs
+++ b/src/systems/heal.rs
@@ -8,7 +8,7 @@ use specs::{
use crate::{
components::{Health, Healing},
- resources::TimeStamp
+ resources::Time
};
@@ -17,19 +17,19 @@ impl <'a> System<'a> for Heal {
type SystemData = (
WriteStorage<'a, Health>,
WriteStorage<'a, Healing>,
- Read<'a, TimeStamp>
+ Read<'a, Time>
);
- fn run(&mut self, (mut healths, mut healing, timestamp): Self::SystemData) {
+ fn run(&mut self, (mut healths, mut healing, time): Self::SystemData) {
for (health, mut heal) in (&mut healths, &mut healing).join() {
if let Some(next_heal) = heal.next_heal {
- if next_heal <= timestamp.time {
+ if next_heal <= time.time {
health.heal(heal.health);
heal.next_heal = None
}
}
if health.health < health.maxhealth && heal.next_heal == None {
- heal.next_heal = Some(timestamp.time + heal.delay)
+ heal.next_heal = Some(time.time + heal.delay)
}
}
}