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/useitem.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/systems/useitem.rs') diff --git a/src/systems/useitem.rs b/src/systems/useitem.rs index 183bd79..1a50865 100644 --- a/src/systems/useitem.rs +++ b/src/systems/useitem.rs @@ -14,12 +14,12 @@ use crate::{ Controller, Position, Inventory, - Attacked + AttackInbox, + AttackMessage }, resources::{NewEntities}, components::item::ItemAction::{None, Build, Eat}, controls::Control, - attack::Attack }; @@ -31,7 +31,7 @@ impl <'a> System<'a> for Use { WriteStorage<'a, Position>, WriteStorage<'a, Inventory>, Write<'a, NewEntities>, - WriteStorage<'a, Attacked> + WriteStorage<'a, AttackInbox> ); fn run(&mut self, (entities, controllers, positions, mut inventories, mut new, mut attacked): Self::SystemData) { @@ -45,7 +45,7 @@ impl <'a> System<'a> for Use { inventory.items.remove(*rank); } Eat(health_diff) => { - Attacked::add_attack(&mut attacked, ent, Attack::new(-*health_diff)); + AttackInbox::add_message(&mut attacked, ent, AttackMessage::new(-*health_diff)); inventory.items.remove(*rank); } None => {} -- cgit