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/trapping.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/systems/trapping.rs') diff --git a/src/systems/trapping.rs b/src/systems/trapping.rs index d6902a8..55b8bde 100644 --- a/src/systems/trapping.rs +++ b/src/systems/trapping.rs @@ -9,7 +9,7 @@ use specs::{ }; use crate::{ - components::{Health, Attacked, Moved, Entered, Trap, Position}, + components::{Health, AttackInbox, Moved, Entered, Trap, Position}, resources::Ground }; @@ -18,7 +18,7 @@ pub struct Trapping; impl <'a> System<'a> for Trapping { type SystemData = ( Entities<'a>, - WriteStorage<'a, Attacked>, + WriteStorage<'a, AttackInbox>, ReadStorage<'a, Health>, ReadStorage<'a, Moved>, ReadStorage<'a, Entered>, @@ -31,7 +31,7 @@ impl <'a> System<'a> for Trapping { for (entity, _entered, trap, position) in (&entities, &entereds, &traps, &positions).join() { for ent in ground.cells.get(&position.pos).unwrap(){ if ent != &entity && moves.contains(*ent) && healths.contains(*ent) { - Attacked::add_attack(&mut victims, *ent, trap.attack.clone()); + AttackInbox::add_message(&mut victims, *ent, trap.attack.clone()); } } } -- cgit