Storage type lookup utility function from World #2117
Labels
A-ECS
Entities, components, systems, and events
C-Code-Quality
A section of code that is hard to understand or change
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
While trying to write a new Query parameter, I need to figure out which storage type a specific component has.
I can only search over the
tables
field of myStorages
, rather than being able to check directly.This is frustratingly indirect and will result in subtle bugs if and when we add more storage types.
What solution would you like?
Create a
lookup(ComponentId) -> StorageType
method on Storages.What alternative(s) have you considered?
I would prefer to just be able to pass in the type directly, but that's not possible :(
Additional context
Discovered during #2116.
When adding this functionality, we should check all other code accessing Storages to see if it applies to future-proof our work.
The text was updated successfully, but these errors were encountered: