-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Implement Bundle for every component and simplify API #2974
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use
Description
What problem does this solve or what need does it fill?
The distinction between components and bundles is often lost on new users, and we end up with a lot of redundant, nearly-duplicated APIs.
What solution would you like?
Implement Bundle for every Component, representing the one element bundle containing only that component.
Remove all duplicated API surfaces, keeping the Component names but accepting bundles:
insertandinsert_bundle->insertremoveandremove_bundle->remove- remove
spawn_bundle; there's now less boilerplate and the design of this routinely confuses the mental model for new users
There are some additional benefits:
- we can remove the #[bundle] annotation in the #[derive(Bundle)] crate
- spawn_batch becomes much easier to work with for simple 0 and 1 component cases
- users cannot accidentally derive component on a standard bundle, as conflicting impls will exist
What alternative(s) have you considered?
Just leave it as is.
Additional context
Design credit to @BoxyUwU, @TheRawMeatball and @Frizi. Originally described here: https://hackmd.io/EvBrYLQeQbCjE2eycBlo3w
Made possible by #2254!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use