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

[Merged by Bors] - Add FromReflect for Visibility #6410

Closed
wants to merge 1 commit into from

Conversation

Shatur
Copy link
Contributor

@Shatur Shatur commented Oct 29, 2022

Objective

  • Visibility don't have FromReflect derive.

Solution

  • Add it.

Changelog

Added

  • FromReflect for Visibility.

@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types A-Hierarchy Parent-child entity hierarchies labels Oct 29, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

How does FromReflect work for Parent/Children? Doesn't it assume a default value? What does this open up?

I'm also a bit reluctant to add this for those because it allows a way to construct those types (even if it's obviously kinda overwrought), which people could abuse to create a malformed hierarchy.

No comments about the Visibility impl; I would merge that as trivial.

@Shatur
Copy link
Contributor Author

Shatur commented Oct 29, 2022

Doesn't it assume a default value?

If I understand correctly, It creates a "default" values using FromWorld impl as Reflect do.
I also not sure if having FromReflect for Parent and Children is necessary. Should I remove it then?

@alice-i-cecile
Copy link
Member

Yeah, remove those for now, we can add them later if needed.

@Shatur
Copy link
Contributor Author

Shatur commented Oct 29, 2022

Okay, done!

@Shatur Shatur changed the title Add FromReflect imls Add FromReflect for Visibility Oct 29, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

bors r+

@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 Oct 29, 2022
bors bot pushed a commit that referenced this pull request Oct 29, 2022
# Objective

- `Visibility` don't have `FromReflect` derive.

## Solution

- Add it.

---

## Changelog

### Added

- `FromReflect` for `Visibility`.
@bors bors bot changed the title Add FromReflect for Visibility [Merged by Bors] - Add FromReflect for Visibility Oct 29, 2022
@bors bors bot closed this Oct 29, 2022
@Shatur Shatur deleted the from-reflect branch October 29, 2022 23:16
@mockersf mockersf added the hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event label Oct 30, 2022
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- `Visibility` don't have `FromReflect` derive.

## Solution

- Add it.

---

## Changelog

### Added

- `FromReflect` for `Visibility`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Hierarchy Parent-child entity hierarchies A-Reflection Runtime information about types C-Usability A simple quality-of-life change that makes Bevy easier to use hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants