From 1019924a29527eba2c8ec8bd976ece6ed76075b0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 25 Feb 2024 23:25:03 +0100 Subject: feat(ecs): add support for multiple system queries & local components --- ecs/examples/with_local.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ecs/examples/with_local.rs') diff --git a/ecs/examples/with_local.rs b/ecs/examples/with_local.rs index d7af0e0..0bd8f66 100644 --- a/ecs/examples/with_local.rs +++ b/ecs/examples/with_local.rs @@ -1,5 +1,5 @@ use ecs::component::Local; -use ecs::system::{Into, System}; +use ecs::system::{Input as SystemInput, Into, System}; use ecs::{Query, World}; struct SomeData @@ -17,6 +17,8 @@ struct SayHelloState cnt: usize, } +impl SystemInput for SayHelloState {} + fn say_hello(mut query: Query<(SomeData, String)>, mut state: Local) { for (data, text) in query.iter_mut() { @@ -50,14 +52,16 @@ fn main() world.register_system( Event::Update, - say_hello.into_system().initialize(SayHelloState { cnt: 0 }), + say_hello + .into_system() + .initialize((SayHelloState { cnt: 0 },)), ); world.register_system( Event::Update, say_whats_up .into_system() - .initialize(SayHelloState { cnt: 0 }), + .initialize((SayHelloState { cnt: 0 },)), ); world.create_entity(( -- cgit v1.2.3-18-g5258