summaryrefslogtreecommitdiff
path: root/ecs/examples/multiple_queries.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/examples/multiple_queries.rs')
-rw-r--r--ecs/examples/multiple_queries.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ecs/examples/multiple_queries.rs b/ecs/examples/multiple_queries.rs
index 4f4198a..9a699c2 100644
--- a/ecs/examples/multiple_queries.rs
+++ b/ecs/examples/multiple_queries.rs
@@ -29,12 +29,12 @@ impl Display for EnemyName
}
}
-fn say_hello(
- mut query: Query<(AttackStrength,)>,
+fn do_attacks(
+ attacker_query: Query<(AttackStrength,)>,
mut enemy_query: Query<(Health, EnemyName)>,
)
{
- for (attack_strength,) in query.iter_mut() {
+ for (attack_strength,) in &attacker_query {
for (health, enemy_name) in enemy_query.iter_mut() {
let damage = match attack_strength {
AttackStrength::Strong => 20,
@@ -66,7 +66,7 @@ fn main()
{
let mut world = World::<Event>::new();
- world.register_system(Event::Start, say_hello);
+ world.register_system(Event::Start, do_attacks);
world.create_entity((
Health { health: 100 },