summaryrefslogtreecommitdiff
path: root/src/componentwrapper.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-01 22:28:02 +0100
committertroido <troido@protonmail.com>2020-03-01 22:28:02 +0100
commit6a7a74e6878ff04e61e6ef21a922e314b9bab271 (patch)
treeb26015955f50856052153019969f7bee8d1cfbd3 /src/componentwrapper.rs
parentc846e929a88837094d7a5383a306df1fec56c333 (diff)
use generics for message components
Diffstat (limited to 'src/componentwrapper.rs')
-rw-r--r--src/componentwrapper.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs
index 2fe114a..08164e4 100644
--- a/src/componentwrapper.rs
+++ b/src/componentwrapper.rs
@@ -7,8 +7,23 @@ use crate::{
RoomId,
Sprite,
playerstate::RoomPos,
- attack::Attack,
- components::{Visible, Movable, Blocking, Player, Floor, Item, Inventory, Health, Serialise, RoomExit, Trap, Fighter, Healing, Volatile},
+ components::{
+ Visible,
+ Movable,
+ Blocking,
+ Player,
+ Floor,
+ Item,
+ Inventory,
+ Health,
+ Serialise,
+ RoomExit,
+ Trap,
+ Fighter,
+ Healing,
+ Volatile,
+ AttackMessage
+ },
parameter::{Parameter, ParameterType}
};
@@ -115,8 +130,8 @@ components!(
}
}
};
- Trap (damage: Int) {Trap{attack: Attack::new(damage)}};
- Fighter (damage: Int, cooldown: Int) {Fighter{attack: Attack::new(damage), cooldown}};
+ Trap (damage: Int) {Trap{attack: AttackMessage::new(damage)}};
+ Fighter (damage: Int, cooldown: Int) {Fighter{attack: AttackMessage::new(damage), cooldown}};
Healing (delay: Int, health: Int) {Healing{delay, health, next_heal: None}};
Volatile (delay: Int) {Volatile{delay, end_time: None}};
);