Bundles should be unordered #1747
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
What problem does this solve or what need does it fill?
Semantically, the ordering of the components in a Bundle shouldn't matter. Components aren't inserted "in order" into our entities and
Bundle(A, B)
should be identical toBundle(B, A)
.Right now though, they're stored as ordered structs / tuples. This is less than ideal because:
What solution would you like?
Bundles are altered to use an unordered collection representation, directly analogous to a HashSet.
What alternative(s) have you considered?
Implement bundle equality, subsetting etc and other needed features in a manual and indirect fashion, by e.g. comparing the HashSet of the TypeId of their components.
Additional context
Discussed on Discord.
Probably blocked on some Rust RFC that I don't know the name of :(
The text was updated successfully, but these errors were encountered: