bevy/crates/bevy_ecs/src
Garett Cooper fa56a5cd51 Add component_id function to World and Components (#5066)
# Objective

- Simplify the process of obtaining a `ComponentId` instance corresponding to a `Component`.
- Resolves #5060.

## Solution

- Add a `component_id::<T: Component>(&self)` function to both `World` and `Components` to retrieve the `ComponentId` associated with `T` from a immutable reference.

---

## Changelog

- Added `World::component_id::<C>()` and `Components::component_id::<C>()` to retrieve a `Component`'s corresponding `ComponentId` if it exists.
2022-06-25 20:41:54 +00:00
..
entity Improve entity and component API docs (#4767) 2022-06-21 15:29:22 +00:00
query Replace ReadOnlyFetch with ReadOnlyWorldQuery (#4626) 2022-06-13 23:35:54 +00:00
schedule Bugfix State::set transition condition infinite loop (#4890) 2022-06-12 19:34:26 +00:00
storage Mark mutable APIs under ECS storage as pub(crate) (#5065) 2022-06-21 20:35:26 +00:00
system Replace ReadOnlyFetch with ReadOnlyWorldQuery (#4626) 2022-06-13 23:35:54 +00:00
world Add component_id function to World and Components (#5066) 2022-06-25 20:41:54 +00:00
archetype.rs Mark mutable APIs under ECS storage as pub(crate) (#5065) 2022-06-21 20:35:26 +00:00
bundle.rs Add comparison methods to FilteredAccessSet (#4211) 2022-05-09 14:39:22 +00:00
change_detection.rs untyped APIs for components and resources (#4447) 2022-05-30 15:32:47 +00:00
component.rs Add component_id function to World and Components (#5066) 2022-06-25 20:41:54 +00:00
event.rs Add a clear() method to the EventReader that consumes the iterator (#4693) 2022-05-13 00:57:04 +00:00
lib.rs Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
reflect.rs bevy_reflect: put serialize into external ReflectSerialize type (#4782) 2022-06-20 17:18:58 +00:00