use ecs::{Query, World}; struct SomeData { num: u64, } fn say_hello(mut query: Query<(SomeData, String)>) { for (data, text) in query.iter_mut() { println!("Hello {}: {}", text, data.num); } } #[derive(Debug, PartialEq, Eq, Hash)] enum Event { Start, } fn main() { let mut world = World::::new(); world.register_system(Event::Start, say_hello); world.create_entity((SomeData { num: 987_654 }, "Yoo".to_string())); world.create_entity((SomeData { num: 345 }, "Haha".to_string())); world.emit(&Event::Start); }