bevy/examples/ecs
CGMossa 86ad5bf420 Adding WorldQuery for WithBundle (#2024)
In response to #2023, here is a draft for a PR. 

Fixes #2023

I've added an example to show how to use `WithBundle`, and also to test it out. 

Right now there is a bug: If a bundle and a query are "the same", then it doesn't filter out
what it needs to filter out. 

Example: 

```
Print component initated from bundle.
[examples/ecs/query_bundle.rs:57] x = Dummy( <========= This should not get printed
    111,
)
[examples/ecs/query_bundle.rs:57] x = Dummy(
    222,
)
Show all components
[examples/ecs/query_bundle.rs:50] x = Dummy(
    111,
)
[examples/ecs/query_bundle.rs:50] x = Dummy(
    222,
)
```

However, it behaves the right way, if I add one more component to the bundle,
so the query and the bundle doesn't look the same:

```
Print component initated from bundle.
[examples/ecs/query_bundle.rs:57] x = Dummy(
    222,
)
Show all components
[examples/ecs/query_bundle.rs:50] x = Dummy(
    111,
)
[examples/ecs/query_bundle.rs:50] x = Dummy(
    222,
)
```

I hope this helps. I'm definitely up for tinkering with this, and adding anything that I'm asked to add
or change. 





Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-04-28 21:03:10 +00:00
..
change_detection.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
ecs_guide.rs Add LogPlugin, otherwise the ambiguity detector doesn't work. (#1740) 2021-03-23 20:29:28 +00:00
event.rs add documentation on LogPlugin and more log usage (#1973) 2021-04-22 23:30:48 +00:00
fixed_timestep.rs add documentation on LogPlugin and more log usage (#1973) 2021-04-22 23:30:48 +00:00
hierarchy.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
parallel_query.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
query_bundle.rs Adding WorldQuery for WithBundle (#2024) 2021-04-28 21:03:10 +00:00
removal_detection.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
startup_system.rs Adopt a Fetch pattern for SystemParams (#1074) 2020-12-15 21:57:16 -08:00
state.rs Fix the left/right movement direction in state example. (#1879) 2021-04-14 23:39:56 +00:00
system_chaining.rs format comments (#1612) 2021-03-11 00:27:30 +00:00
system_param.rs Allow deriving SystemParam on private types (#1936) 2021-04-16 18:40:49 +00:00
system_sets.rs Add system sets and run criteria example (#1909) 2021-04-23 19:08:16 +00:00
timers.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00