Skip to content
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

Prototype Indexing #1587

Closed
wants to merge 6 commits into from
Closed

Conversation

TheRawMeatball
Copy link
Member

Indexing is a highly requested feature (#1205) that we currently don't have an answer to. This PR implements one possible version of indexing, by eagerly updating the index to ensure it's always valid.

@alice-i-cecile alice-i-cecile mentioned this pull request Mar 7, 2021
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events help wanted labels Mar 8, 2021
Copy link
Contributor

@Davier Davier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably need to handle removed components with a second exclusive system in the last stage

}
pub struct ActiveIndexed<'a, T: Component + Eq + Hash + Clone> {
indexed: &'a mut Indexed<'a, T>,
orig_value: T,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to store its hash instead and drop the Clone bound, but HashMap::raw_entry() is not stable. Maybe we could use hashbrown: https://docs.rs/hashbrown/0.9.1/hashbrown/hash_map/struct.HashMap.html#method.raw_entry_mut

@alice-i-cecile alice-i-cecile added the S-Needs-Design-Doc This issue or PR is particularly complex, and needs an approved design doc before it can be merged label Apr 23, 2021
@cart cart added the S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work label Jul 23, 2021
@mockersf mockersf removed the S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work label Jul 24, 2021
@TheRawMeatball
Copy link
Member Author

Closing, might reimplement in a separate PR once #2254 lands.

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 S-Needs-Design-Doc This issue or PR is particularly complex, and needs an approved design doc before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants