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

Make some ReflectComponent/ReflectBundle methods work with EntityMut too #12895

Merged
merged 2 commits into from Apr 8, 2024

Conversation

SkiFire13
Copy link
Contributor

Objective

  • Make ReflectComponent::apply, ReflectComponent::reflect_mut and ReflectBundle::apply work with EntityMut too (currently they only work with the more restricting EntityWorldMut);
  • Note: support for the Filtered* variants has been left out since the conversion in that case is more expensive. Let me know if I should add support for them too.

Solution

  • Make ReflectComponent::apply, ReflectComponent::reflect_mut and ReflectBundle::apply take an impl Into<EntityMut<'a>>;
  • Make the corresponding *Fns function pointers take a EntityMut.

Changelog

  • ReflectComponent::apply, ReflectComponent::reflect_mut and ReflectBundle::apply now accept EntityMut as well

Migration Guide

  • ReflectComponentFns's apply and reflect_mut fields now take EntityMut instead of &mut EntityWorldMut
  • ReflectBundleFns's apply field now takes EntityMut instead of &mut EntityWorldMut

@james7132 james7132 added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types labels Apr 7, 2024
github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2024
# Objective

- Implement `From<&'w mut EntityMut>` for `EntityMut<'w>`;
- Make it possible to pass `&mut EntityMut` where `impl Into<EntityMut>`
is required;
- Helps with #12895.

## Solution

- Implement `From<&'w mut EntityMut>` for `EntityMut<'w>`

---

## Changelog

- `EntityMut<'w>` now implements `From<&'w mut EntityMut>`
@james7132 james7132 added this pull request to the merge queue Apr 8, 2024
Merged via the queue into bevyengine:main with commit 74f5207 Apr 8, 2024
31 checks passed
@SkiFire13 SkiFire13 deleted the reflect-component-entity-mut branch April 8, 2024 05:40
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 A-Reflection Runtime information about types C-Usability A simple quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants