An easier way to register multiple components' storage at once #1794
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
What problem does this solve or what need does it fill?
Registering many components as
SparseSet
at once is not ergonomic, as it requires a lot of repetition.For my specific context, I am creating a state machine that uses a wrapper with different types to represent the current state. This also means I'd like to register these all as
SparseSet
as they will be added/removed frequently. For the following examples, I have a lot ofCombatState<_>
component types representing a state.What solution would you like?
@alice-i-cecile proposed a
register_bundle
name. I'm not exactly sure what that might look like, but I would guess it could look likeBut I don't think that works 100%...
What alternative(s) have you considered?
Currently, I am manually registering these components, which is not ideal.
It's also possible that this request is also related to changing the storage type in general. Will users generally want to access the entire
ComponentDescriptor
struct? In my case, I think something like.register_component_storage::<TargetComponent>(StorageType::SparseSet)
may be worth investigating, but I haven't given it more thought than that.Additionally, it's further possible that this exists and I just missed it!
The text was updated successfully, but these errors were encountered: