summaryrefslogtreecommitdiff
path: root/src/room.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/room.rs
parentf8364fb636a8e9276939ae8523966b038388e4ff (diff)
implemented growth
Diffstat (limited to 'src/room.rs')
-rw-r--r--src/room.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/room.rs b/src/room.rs
index e7153b7..f41350a 100644
--- a/src/room.rs
+++ b/src/room.rs
@@ -22,7 +22,7 @@ use crate::{
Spawn as SpawnPosition,
Players,
Emigration,
- TimeStamp
+ Time
},
components::{
Position,
@@ -64,7 +64,8 @@ use crate::{
Die,
Spawn,
Interact,
- DropLoot
+ DropLoot,
+ Growth
}
};
@@ -72,6 +73,7 @@ pub fn default_dispatcher<'a, 'b>() -> Dispatcher<'a, 'b> {
DispatcherBuilder::new()
.with(Volate, "volate", &[])
.with(RegisterNew::default(), "registernew", &[])
+ .with(Growth, "growth", &["registernew"])
.with(UpdateCooldowns, "cool_down", &["registernew"])
.with(Spawn, "spawn", &["registernew"])
.with(ControlInput, "controlinput", &["cool_down"])
@@ -88,7 +90,7 @@ pub fn default_dispatcher<'a, 'b>() -> Dispatcher<'a, 'b> {
.with(DropLoot, "droploot", &["attacking"])
.with(View::default(), "view", &["move", "attacking", "volate", "die"])
.with(Migrate, "migrate", &["view"])
- .with(Create, "create", &["view", "spawn", "droploot"])
+ .with(Create, "create", &["view", "spawn", "droploot", "growth"])
.with(Remove, "remove", &["view", "move", "droploot"])
.build()
}
@@ -119,8 +121,8 @@ impl <'a, 'b>Room<'a, 'b> {
world.insert(NewEntities::new(encyclopedia));
register_insert!(
world,
- (Position, Visible, Controller, Movable, Blocking, Floor, New, Removed, Moved, Player, Inventory, Health, Serialise, RoomExit, Entered, Dead, Trap, Fighter, Healing, Volatile, ControlCooldown, Autofight, MonsterAI, Home, Mortal, AttackInbox, Item, Spawner, Clan, Faction, Interactable, Loot),
- (Ground, Input, Output, Size, Spawn, Players, Emigration, TimeStamp)
+ (Position, Visible, Controller, Movable, Blocking, Floor, New, Removed, Moved, Player, Inventory, Health, Serialise, RoomExit, Entered, Dead, Trap, Fighter, Healing, Volatile, ControlCooldown, Autofight, MonsterAI, Home, Mortal, AttackInbox, Item, Spawner, Clan, Faction, Interactable, Loot, Grow),
+ (Ground, Input, Output, Size, Spawn, Players, Emigration, Time)
);
Room {
@@ -164,7 +166,7 @@ impl <'a, 'b>Room<'a, 'b> {
}
pub fn update(&mut self, timestamp: Timestamp) {
- self.world.fetch_mut::<TimeStamp>().time = timestamp;
+ self.world.fetch_mut::<Time>().time = timestamp;
self.dispatcher.dispatch(&self.world);
self.world.maintain();
}
@@ -263,7 +265,7 @@ impl <'a, 'b>Room<'a, 'b> {
}
pub fn get_time(&self) -> Timestamp {
- self.world.fetch::<TimeStamp>().time
+ self.world.fetch::<Time>().time
}
}