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/with_local.rs | |
parent | 9d8c73dd2671131929967214433dae5479e95b5b (diff) |
chore(ecs): remove Event trait id method & take events by value
Diffstat (limited to 'ecs/examples/with_local.rs')
-rw-r--r-- | ecs/examples/with_local.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/ecs/examples/with_local.rs b/ecs/examples/with_local.rs index eb5de28..5890b90 100644 --- a/ecs/examples/with_local.rs +++ b/ecs/examples/with_local.rs @@ -1,5 +1,5 @@ use ecs::component::local::Local; -use ecs::event::{Event, Id as EventId}; +use ecs::event::Event; use ecs::system::{Into, System}; use ecs::{Component, Query, World}; @@ -45,27 +45,21 @@ fn say_whats_up(query: Query<(SomeData, Name)>, mut state: Local<SayHelloState>) #[derive(Debug)] struct Update; -impl Event for Update -{ - fn id(&self) -> EventId - { - EventId::of::<Self>() - } -} +impl Event for Update {} fn main() { let mut world = World::new(); world.register_system( - &Update, + Update, say_hello .into_system() .initialize((SayHelloState { cnt: 0 },)), ); world.register_system( - &Update, + Update, say_whats_up .into_system() .initialize((SayHelloState { cnt: 0 },)), @@ -75,9 +69,9 @@ fn main() world.create_entity((SomeData { num: 345 },)); - world.emit(&Update); + world.emit(Update); println!("Haha"); - world.emit(&Update); + world.emit(Update); } |