bevy/crates
James O'Brien f9853cbbc2 Add get_entity to Commands (#5854)
# Objective

- Fixes #5850 

## Solution

- As described in the issue, added a `get_entity` method on `Commands` that returns an `Option<EntityCommands>`

## Changelog
- Added the new method with a simple doc test
- I have re-used `get_entity` in `entity`, similarly to how `get_single` is used in `single` while additionally preserving the error message
- Add `#[inline]` to both functions

Entities that have commands queued to despawn system will still return commands when `get_entity` is called but that is representative of the fact that the entity is still around until those commands are flushed.

A potential `contains_entity` could also be added in this PR if desired, that would effectively be replacing Entities.contains but may be more discoverable if this is a common use case.


Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-09-01 22:06:46 +00:00
..
bevy_animation Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_app Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_asset Add note on ordering to AssetServerSettings docs. (#5706) 2022-08-30 02:40:18 +00:00
bevy_audio Remove Sync requirement in Decodable::Decoder (#5819) 2022-08-29 23:02:12 +00:00
bevy_core Add missing type registrations for bevy_math types (#5758) 2022-08-23 21:19:29 +00:00
bevy_core_pipeline register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_diagnostic Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_dylib Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_dynamic_plugin Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_ecs Add get_entity to Commands (#5854) 2022-09-01 22:06:46 +00:00
bevy_ecs_compile_fail_tests Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_encase_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gilrs Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gltf Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00
bevy_hierarchy Remove duplicate asserts in test (#5648) 2022-08-15 23:03:42 +00:00
bevy_input register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_internal Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_log Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_macro_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_math Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_mikktspace Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_pbr Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00
bevy_ptr Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_reflect Remove extra spaces from Range reflect impls (#5839) 2022-08-30 21:39:48 +00:00
bevy_render Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00
bevy_scene Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_sprite Use 3 bits of PipelineKey to store MSAA sample count (#5826) 2022-08-30 03:00:39 +00:00
bevy_tasks Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_text register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_time Added the ability to get or set the last change tick of a system. (#5838) 2022-08-31 01:53:15 +00:00
bevy_transform Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00
bevy_ui Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00
bevy_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_window Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_winit Fix window centering when scale_factor is not 1.0 (#5582) 2022-08-30 20:13:38 +00:00