diff options
author | HampusM <hampus@hampusmat.com> | 2024-04-10 19:51:46 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-04-10 19:51:46 +0200 |
commit | c70e06c6d879208eb2822f6207ea7b29d47c2087 (patch) | |
tree | 06b5b7ae8fbf69d6041fff1c576d7610ff6fba6a /ecs/examples/simple.rs | |
parent | 9d8c73dd2671131929967214433dae5479e95b5b (diff) |
chore(ecs): remove Event trait id method & take events by value
Diffstat (limited to 'ecs/examples/simple.rs')
-rw-r--r-- | ecs/examples/simple.rs | 14 |
1 files changed, 4 insertions, 10 deletions
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::<Self>() - } -} +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); } |