summaryrefslogtreecommitdiff
path: root/ecs/examples/multiple_queries.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-04-10 19:51:46 +0200
committerHampusM <hampus@hampusmat.com>2024-04-10 19:51:46 +0200
commitc70e06c6d879208eb2822f6207ea7b29d47c2087 (patch)
tree06b5b7ae8fbf69d6041fff1c576d7610ff6fba6a /ecs/examples/multiple_queries.rs
parent9d8c73dd2671131929967214433dae5479e95b5b (diff)
chore(ecs): remove Event trait id method & take events by value
Diffstat (limited to 'ecs/examples/multiple_queries.rs')
-rw-r--r--ecs/examples/multiple_queries.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/ecs/examples/multiple_queries.rs b/ecs/examples/multiple_queries.rs
index e914cc6..ab442be 100644
--- a/ecs/examples/multiple_queries.rs
+++ b/ecs/examples/multiple_queries.rs
@@ -1,6 +1,6 @@
use std::fmt::Display;
-use ecs::event::{Event, Id as EventId};
+use ecs::event::Event;
use ecs::{Component, Query, World};
#[derive(Component)]
@@ -60,19 +60,13 @@ fn do_attacks(
#[derive(Debug, PartialEq, Eq, Hash)]
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, do_attacks);
+ world.register_system(Start, do_attacks);
world.create_entity((
Health { health: 100 },
@@ -92,5 +86,5 @@ fn main()
world.create_entity((AttackStrength::Strong,));
world.create_entity((AttackStrength::Weak,));
- world.emit(&Start);
+ world.emit(Start);
}