summaryrefslogtreecommitdiff
path: root/src/world.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/world.rs
parent4718cfdc7c2bf67d2389ca18ab035fe5a0887ff0 (diff)
healing works now too, the first time based system
Diffstat (limited to 'src/world.rs')
-rw-r--r--src/world.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/world.rs b/src/world.rs
index 9c22e0f..9f86cb8 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -21,7 +21,8 @@ pub struct World<'a, 'b> {
default_room: RoomId,
players: HashMap<PlayerId, RoomId>,
rooms: HashMap<RoomId, Room<'a, 'b>>,
- encyclopedia: Encyclopedia
+ encyclopedia: Encyclopedia,
+ timestamp: i64
}
@@ -34,7 +35,8 @@ impl <'a, 'b>World<'a, 'b> {
default_room,
encyclopedia,
players: HashMap::new(),
- rooms: HashMap::new()
+ rooms: HashMap::new(),
+ timestamp: 0
}
}
@@ -92,8 +94,9 @@ impl <'a, 'b>World<'a, 'b> {
pub fn update(&mut self) {
self.migrate();
for room in self.rooms.values_mut() {
- room.update();
+ room.update(self.timestamp);
}
+ self.timestamp += 1;
}
fn migrate(&mut self) {