-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Move methods on Children that mutate to EntityCommands #15270
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplishedX-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Description
What problem does this solve or what need does it fill?
All of our hierarchy management controls happen through Commands, except methods of sorting children for a given entity. These methods should be changed to Commands like the rest of the hierarchy management. This might be required when changing Children to a relation, anyways.
What solution would you like?
Replace the following methods with commands:
Children::swapChildren::sort_byChildren::sort_by_keyChildren::sort_by_cached_keyChildren::sort_unstable_byChildren::sort_unstable_by_key
Ideally:
impl EntityCommands {
pub fn sort_children_by(&mut self, compare: impl FnMut(Entity, Entity) -> Ordering) -> &mut Self;
pub fn sort_children_by_key<K: Ord>(&mut self, compare: impl FnMut(Entity) -> K) -> &mut Self;
// etc...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplishedX-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through