Skip to content

Condense insert / insert_bundle and related methods #2255

Closed
@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

Various commands operate on either components or bundles. The end user doesn't want to think up which one they're using, and this leads to code duplication and API bloat.

What solution would you like?

Condense .insert_bundle, .remove_bundle and so on down into single methods that operate on either bundles or components.

My preference would be to use a shared trait that is implied by both the Component and Bundle trait to do so.

What alternative(s) have you considered?

As a hack, you could make derive(Component) also implement Bundle, and then only keep the bundle forms around.

Additional context

Enabled by #1843 (and #2254). Inspired by #2252, which encourages a hard split between components and bundles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be merged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions