diff options
| author | troido <troido@protonmail.com> | 2020-03-01 22:28:02 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-01 22:28:02 +0100 |
| commit | 6a7a74e6878ff04e61e6ef21a922e314b9bab271 (patch) | |
| tree | b26015955f50856052153019969f7bee8d1cfbd3 /src/systems/trapping.rs | |
| parent | c846e929a88837094d7a5383a306df1fec56c333 (diff) | |
use generics for message components
Diffstat (limited to 'src/systems/trapping.rs')
| -rw-r--r-- | src/systems/trapping.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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()); } } } |
