bevy/crates/bevy_ecs/src
Peter Hayman f516de456b
Add EntityWorldMut::remove_by_id (#12842)
# Objective

- Add `remove_by_id` method to `EntityWorldMut` and `EntityCommands`
- This is a duplicate of the awesome work by @mateuseap, last updated
04/09/23 - #9663
- I'm opening a second one to ensure the feature makes it into `0.14`
- Fixes #9261

## Solution

Almost identical to #9663 with three exceptions
- Uses a closure instead of struct for commands, consistent with other
similar commands
- Does not refactor `EntityCommands::insert`, so no migration guide
- `EntityWorldMut::remove_by_id` is now safe containing unsafe blocks, I
think thats what @SkiFire13 was indicating should happen [in this
comment](https://github.com/bevyengine/bevy/pull/9663#discussion_r1314307525)

## Changelog

- Added `EntityWorldMut::remove_by_id` method and its tests.
- Added `EntityCommands::remove_by_id` method and its tests.

---------

Co-authored-by: James Liu <contact@jamessliu.com>
2024-04-03 09:50:32 +00:00
..
entity Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
identifier fix some typos (#12038) 2024-02-22 18:55:22 +00:00
query Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
reflect Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
schedule Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
storage Remove unnecessary branch in query iteration (#12844) 2024-04-02 06:02:56 +00:00
system Add EntityWorldMut::remove_by_id (#12842) 2024-04-03 09:50:32 +00:00
world Add EntityWorldMut::remove_by_id (#12842) 2024-04-03 09:50:32 +00:00
archetype.rs Adding some docs for archetype internals (#12578) 2024-03-23 01:48:31 +00:00
bundle.rs Update safety comment for bundle removal (#12657) 2024-03-23 22:07:08 +00:00
change_detection.rs Implement MutUntyped::from(mut_typed) (#12406) 2024-03-10 12:46:50 +00:00
component.rs Remove ComponentStorage and associated types (#12311) 2024-03-05 15:54:52 +00:00
event.rs Implement Clone for ManualEventReader (#12777) 2024-03-29 14:49:13 +00:00
lib.rs Forbid unsafe in most crates in the engine (#12684) 2024-03-27 03:30:08 +00:00
removal_detection.rs Add RemovedComponentEvents::iter (#12815) 2024-04-01 20:20:30 +00:00