bevy/crates/bevy_ecs/src
Zachary Harrold 1974723a63
Deprecated Various Component Methods from Query and QueryState (#9920)
# Objective

- (Partially) Fixes #9904
- Acts on #9910

## Solution

- Deprecated the relevant methods from `Query`, cascading changes as
required across Bevy.

---

## Changelog

- Deprecated `QueryState::get_component_unchecked_mut` method
- Deprecated `Query::get_component` method
- Deprecated `Query::get_component_mut` method
- Deprecated `Query::component` method
- Deprecated `Query::component_mut` method
- Deprecated `Query::get_component_unchecked_mut` method

## Migration Guide

### `QueryState::get_component_unchecked_mut`

Use `QueryState::get_unchecked_manual` and select for the exact
component based on the structure of the exact query as required.

### `Query::(get_)component(_unchecked)(_mut)`

Use `Query::get` and select for the exact component based on the
structure of the exact query as required.

- For mutable access (`_mut`), use `Query::get_mut`
- For unchecked access (`_unchecked`), use `Query::get_unchecked`
- For panic variants (non-`get_`), add `.unwrap()`

## Notes

- `QueryComponentError` can be removed once these deprecated methods are
also removed. Due to an interaction with `thiserror`'s derive macro, it
is not marked as deprecated.
2024-02-04 01:01:59 +00:00
..
entity Add a doctest example for EntityMapper (#11583) 2024-01-29 16:56:44 +00:00
identifier Unified identifer for entities & relations (#9797) 2024-01-13 01:09:32 +00:00
query Deprecated Various Component Methods from Query and QueryState (#9920) 2024-02-04 01:01:59 +00:00
reflect Make the MapEntities trait generic over Mappers, and add a simpler EntityMapper (#11428) 2024-01-28 19:51:46 +00:00
schedule Use TypeIdMap whenever possible (#11684) 2024-02-03 23:47:04 +00:00
storage Double the capacity when BlobVec is full (#11167) 2024-01-22 15:05:34 +00:00
system Deprecated Various Component Methods from Query and QueryState (#9920) 2024-02-04 01:01:59 +00:00
world Make Archetypes.archetype_component_count private (#10774) 2024-02-03 00:07:50 +00:00
archetype.rs Make Archetypes.archetype_component_count private (#10774) 2024-02-03 00:07:50 +00:00
bundle.rs Use TypeIdMap whenever possible (#11684) 2024-02-03 23:47:04 +00:00
change_detection.rs Simplify conditions (#11316) 2024-01-13 13:22:17 +00:00
component.rs Use TypeIdMap whenever possible (#11684) 2024-02-03 23:47:04 +00:00
event.rs Fix bug where events are not being dropped (#11528) 2024-02-02 21:14:54 +00:00
lib.rs Use TypeIdMap whenever possible (#11684) 2024-02-03 23:47:04 +00:00
removal_detection.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00