-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Rename init_component and init_component_with_desciptor #15451
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 useD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with BevyS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
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 useD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with BevyS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
App::init_componentregisters a component with the App's main world, configuring itsComponentDescriptor. It should almost never be called by end users as they're called internally when setting up queries.App::init_resourceinitializes a resource with default values in the world, and is a common API.This false parallel is confusing!
What solution would you like?
Rename
init_componentandinit_component_with_desciptorto be calledregister_*, wherever they are defined (both App and World have methods at least).Consider improving the docs for these methods while you're there, but you don't have to.
What alternative(s) have you considered?
We could call these
initalize_component, but that's still unclear and confusing. We could instead call theseget_component_id, but that's also a bit misleading: these methods do actually initialize things and need to be called even if the result is discarded.Additional context
#15448 recommends adding another parallel method for resources. This should be renamed as well.