-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 Command
s, except methods of sorting children for a given entity. These methods should be changed to Command
s 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::swap
Children::sort_by
Children::sort_by_key
Children::sort_by_cached_key
Children::sort_unstable_by
Children::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...
}
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