Skip to content

Move methods on Children that mutate to EntityCommands #15270

@ItsDoot

Description

@ItsDoot

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:

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

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedX-ContentiousThere are nontrivial implications that should be thought through

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions