diff options
Diffstat (limited to 'ecs/examples/optional_component.rs')
-rw-r--r-- | ecs/examples/optional_component.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ecs/examples/optional_component.rs b/ecs/examples/optional_component.rs index e47bf2e..bcc0c54 100644 --- a/ecs/examples/optional_component.rs +++ b/ecs/examples/optional_component.rs @@ -1,4 +1,4 @@ -use ecs::event::Event; +use ecs::phase::UPDATE as UPDATE_PHASE; use ecs::{Component, Query, World}; #[derive(Debug, Component)] @@ -48,16 +48,11 @@ fn pet_cats(query: Query<(CatName, PettingCapacity, Option<Aggressivity>)>) } } -#[derive(Debug)] -struct PettingTime; - -impl Event for PettingTime {} - fn main() { let mut world = World::new(); - world.register_system(PettingTime, pet_cats); + world.register_system(*UPDATE_PHASE, pet_cats); world.create_entity(( CatName { name: "Jasper".to_string() }, @@ -82,5 +77,5 @@ fn main() Aggressivity::Low, )); - world.emit(PettingTime); + world.step(); } |