diff options
Diffstat (limited to 'ecs/examples/relationship.rs')
-rw-r--r-- | ecs/examples/relationship.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ecs/examples/relationship.rs b/ecs/examples/relationship.rs index e8fb327..240884a 100644 --- a/ecs/examples/relationship.rs +++ b/ecs/examples/relationship.rs @@ -1,4 +1,4 @@ -use ecs::event::start::Start as StartEvent; +use ecs::phase::START as START_PHASE; use ecs::relationship::Relationship; use ecs::{Component, Query, World}; @@ -19,7 +19,9 @@ struct Health struct Holding; -fn print_player_stats(player_query: Query<(Player, Health, Relationship<Holding, Sword>)>) +fn print_player_stats( + player_query: Query<(&Player, &Health, &Relationship<Holding, Sword>)>, +) { for (_, health, sword_relationship) in &player_query { println!("Player health: {}", health.health); @@ -34,7 +36,7 @@ fn main() { let mut world = World::new(); - world.register_system(StartEvent, print_player_stats); + world.register_system(*START_PHASE, print_player_stats); let sword_uid = world.create_entity((Sword { attack_strength: 17 },)); @@ -44,5 +46,5 @@ fn main() Relationship::<Holding, Sword>::new(sword_uid), )); - world.emit(StartEvent); + world.step(); } |