From c70e06c6d879208eb2822f6207ea7b29d47c2087 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 10 Apr 2024 19:51:46 +0200 Subject: chore(ecs): remove Event trait id method & take events by value --- ecs/examples/simple.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ecs/examples/simple.rs') diff --git a/ecs/examples/simple.rs b/ecs/examples/simple.rs index 9983c4a..6949308 100644 --- a/ecs/examples/simple.rs +++ b/ecs/examples/simple.rs @@ -1,4 +1,4 @@ -use ecs::event::{Event, Id as EventId}; +use ecs::event::Event; use ecs::{Component, Query, World}; #[derive(Component)] @@ -23,19 +23,13 @@ fn say_hello(query: Query<(SomeData, Greeting)>) #[derive(Debug)] struct Start; -impl Event for Start -{ - fn id(&self) -> EventId - { - EventId::of::() - } -} +impl Event for Start {} fn main() { let mut world = World::new(); - world.register_system(&Start, say_hello); + world.register_system(Start, say_hello); world.create_entity(( SomeData { num: 987_654 }, @@ -49,5 +43,5 @@ fn main() Greeting { greeting: "Good evening".to_string() }, )); - world.emit(&Start); + world.emit(Start); } -- cgit v1.2.3-18-g5258