From 6a7a74e6878ff04e61e6ef21a922e314b9bab271 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 1 Mar 2020 22:28:02 +0100 Subject: use generics for message components --- src/systems/fight.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/systems/fight.rs') diff --git a/src/systems/fight.rs b/src/systems/fight.rs index 547f5fa..42a7543 100644 --- a/src/systems/fight.rs +++ b/src/systems/fight.rs @@ -12,7 +12,7 @@ use specs::{ use crate::components::{ Controller, Position, - Attacked, + AttackInbox, Fighter, Health, ControlCooldown @@ -30,7 +30,7 @@ impl <'a> System<'a> for Fight { ReadStorage<'a, Controller>, WriteStorage<'a, Position>, Read<'a, Ground>, - WriteStorage<'a, Attacked>, + WriteStorage<'a, AttackInbox>, ReadStorage<'a, Fighter>, ReadStorage<'a, Health>, WriteStorage<'a, ControlCooldown> @@ -43,7 +43,7 @@ impl <'a> System<'a> for Fight { for direction in directions { for ent in ground.cells.get(&(position.pos + direction.to_position())).unwrap_or(&HashSet::new()) { if healths.contains(*ent) && *ent != entity { - Attacked::add_attack(&mut attacked, *ent, fighter.attack.clone()); + AttackInbox::add_message(&mut attacked, *ent, fighter.attack.clone()); cooldowns.insert(entity, ControlCooldown{amount: fighter.cooldown}).unwrap(); break; } -- cgit