bevy/crates/bevy_ecs/src/system/commands
eugineerd 3caca428c0
allow EntityCloner to move components without Clone or Reflect (#20065)
# Objective
Fix #18079 

## Solution
- `EntityCloner` can now move components that don't have `Clone` or
`Reflect` implementation.
- Components with `ComponentCloneBehavior::Ignore` will not be moved.
- Components with `ComponentCloneBehavior::Custom` will be cloned using
their defined `ComponentCloneFn` and then removed from the source entity
to respect their `queue_deferred` logic.
- Relationships still need to be `Clone` or `Reflect` to be movable.
- Custom relationship data is now correctly preserved when cloned or
moved using `EntityCloner`.

## Testing
- Added new tests for moving components

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-14 22:33:01 +00:00
..
command.rs Rename send_event and similar methods to write_event (#20017) 2025-07-07 22:05:16 +00:00
entity_command.rs allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
mod.rs allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
parallel_scope.rs bevy_ecs/system/commands/ folder docs pass (#18639) 2025-03-31 19:26:58 +00:00