diff options
| author | HampusM <hampus@hampusmat.com> | 2024-02-25 23:25:03 +0100 | 
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2024-02-26 19:54:00 +0100 | 
| commit | 1019924a29527eba2c8ec8bd976ece6ed76075b0 (patch) | |
| tree | b26d8bd872684a0c87802e057d8952c42be31f7a /ecs/examples/with_local.rs | |
| parent | 00055d6af92d59a86eb00f110c77c699a562d33e (diff) | |
feat(ecs): add support for multiple system queries & local components
Diffstat (limited to 'ecs/examples/with_local.rs')
| -rw-r--r-- | ecs/examples/with_local.rs | 10 | 
1 files changed, 7 insertions, 3 deletions
| 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<SayHelloState>)  {      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(( | 
