summaryrefslogtreecommitdiff
path: root/src/systems/useitem.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-01 22:28:02 +0100
committertroido <troido@protonmail.com>2020-03-01 22:28:02 +0100
commit6a7a74e6878ff04e61e6ef21a922e314b9bab271 (patch)
treeb26015955f50856052153019969f7bee8d1cfbd3 /src/systems/useitem.rs
parentc846e929a88837094d7a5383a306df1fec56c333 (diff)
use generics for message components
Diffstat (limited to 'src/systems/useitem.rs')
-rw-r--r--src/systems/useitem.rs8
1 files changed, 4 insertions, 4 deletions
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 => {}