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

Added reflect support for std::HashSet, BTreeSet and BTreeMap. #12124

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

mintlu8
Copy link
Contributor

@mintlu8 mintlu8 commented Feb 26, 2024

Objective

Added reflect support for std::HashSet, BTreeSet and BTreeMap.

The set support is limited to reflect_value since that's the level of support prior art bevy_util::HashSet got.

Changelog

Dropped Hash Requirement on MapInfo since it's not needed on BTreeMaps.

@mintlu8 mintlu8 marked this pull request as ready for review February 26, 2024 13:48
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types labels Feb 26, 2024
Copy link
Contributor

@soqb soqb left a comment

Choose a reason for hiding this comment

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

lgtm! the Map trait is in my sights for a refactoring but this implementation fits it as it stands.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 26, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 26, 2024
Merged via the queue into bevyengine:main with commit f45450e Feb 26, 2024
27 checks passed
@@ -620,6 +622,220 @@ impl_type_path!(::bevy_utils::hashbrown::hash_map::DefaultHashBuilder);
impl_type_path!(::bevy_utils::NoOpHash);
impl_type_path!(::bevy_utils::hashbrown::HashMap<K, V, S>);

macro_rules! impl_reflect_for_btree_map {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this macro really necessary? It's not like it will be used more than once, and it makes source navigation harder.

msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
…ngine#12124)

# Objective

Added reflect support for `std::HashSet`, `BTreeSet` and `BTreeMap`.

The set support is limited to `reflect_value` since that's the level of
support prior art `bevy_util::HashSet` got.

## Changelog

Dropped `Hash` Requirement on `MapInfo` since it's not needed on
`BTreeMap`s.
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
…ngine#12124)

# Objective

Added reflect support for `std::HashSet`, `BTreeSet` and `BTreeMap`.

The set support is limited to `reflect_value` since that's the level of
support prior art `bevy_util::HashSet` got.

## Changelog

Dropped `Hash` Requirement on `MapInfo` since it's not needed on
`BTreeMap`s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants