Skip to content

Prototype Indexing#1587

Closed
TheRawMeatball wants to merge 6 commits intobevyengine:mainfrom
TheRawMeatball:indexing-v1
Closed

Prototype Indexing#1587
TheRawMeatball wants to merge 6 commits intobevyengine:mainfrom
TheRawMeatball:indexing-v1

Conversation

@TheRawMeatball
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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