bevy/crates/bevy_hierarchy/src
JaySpruce d0afdc6b45
Move clone_entity commands to EntityCommands (#16672)
## Objective

I was resolving a conflict between #16132 and my PR #15929 and thought
the `clone_entity` commands made more sense in `EntityCommands`.

## Solution

Moved `Commands::clone_entity` to `EntityCommands::clone`, moved
`Commands::clone_entity_with` to `EntityCommands::clone_with`.

## Testing

Ran the two tests that used the old methods.

## Showcase

```
// Create a new entity and keep its EntityCommands.
let mut entity = commands.spawn((ComponentA(10), ComponentB(20)));

// Create a clone of the first entity
let mut entity_clone = entity.clone();
```

The only potential downside is that the method name is now the same as
the one from the `Clone` trait. `EntityCommands` doesn't implement
`Clone` though, so there's no actual conflict.

Maybe I'm biased because this'll work better with my PR, but I think the
UX is nicer regardless.
2024-12-06 15:54:35 +00:00
..
components Window picking (#16103) 2024-12-05 21:14:39 +00:00
child_builder.rs Allow World::entity family of functions to take multiple entities and get multiple references back (#15614) 2024-10-07 15:21:40 +00:00
events.rs Fix bevy_hierarchy failing to compile without reflect feature (#16428) 2024-11-19 01:28:42 +00:00
hierarchy.rs Move clone_entity commands to EntityCommands (#16672) 2024-12-06 15:54:35 +00:00
lib.rs Fix permissions of rust source files (#16310) 2024-11-09 16:34:38 +00:00
query_extension.rs Migrate from Query::single and friends to Single (#15872) 2024-10-13 20:32:06 +00:00
valid_parent_check_plugin.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00