-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WorldId Hash and SparseSetIndex #7124
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
Comments
recatek
added
C-Feature
A new feature, making something new possible
S-Needs-Triage
This issue needs to be labelled
labels
Jan 7, 2023
alice-i-cecile
added
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
and removed
C-Feature
A new feature, making something new possible
S-Needs-Triage
This issue needs to be labelled
labels
Jan 8, 2023
2ne1ugly
moved this from Viewed
to In Progress / Waiting for Merge
in Mango's Open Source Task Board
Jan 8, 2023
2ne1ugly
moved this from In Progress / Waiting for Merge
to Resolved
in Mango's Open Source Task Board
Jan 10, 2023
james7132
pushed a commit
to james7132/bevy
that referenced
this issue
Jan 21, 2023
# Objective - Fixes bevyengine#7124 ## Solution - Add Hash Derive on `WorldId` - Add `SparseSetIndex` impl
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# Objective - Fixes bevyengine#7124 ## Solution - Add Hash Derive on `WorldId` - Add `SparseSetIndex` impl
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective - Fixes bevyengine#7124 ## Solution - Add Hash Derive on `WorldId` - Add `SparseSetIndex` impl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
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?
Currently WorldId can't be hashed in HashMap or used as a key in a SparseSet within bevy. This makes it challenging to branch behavior based on specific worlds (e.g. doing things differently for different SubApps). WorldId just wraps a usize so this should be safe to do.
What solution would you like?
Implement/derive Hash and SparseSetIndex for World.
What alternative(s) have you considered?
Worlds could be semi-uniquely identified through other means, like having a unique resource, but adding utility to the world's ID seems like the most straightforward choice.
Additional context
This would be particularly useful for generalizing cross-app
extract
functions. This came up while I was trying to make a extract function manager between a parent and multiple SubApp worlds, like so:The text was updated successfully, but these errors were encountered: