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/fight.rs | |
| parent | c846e929a88837094d7a5383a306df1fec56c333 (diff) | |
use generics for message components
Diffstat (limited to 'src/systems/fight.rs')
| -rw-r--r-- | src/systems/fight.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |
