bevy/crates/bevy_ecs/src/reflect
Giacomo Stevanato 74f52076a3
Make some ReflectComponent/ReflectBundle methods work with EntityMut too (#12895)
# 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`
2024-04-08 01:46:07 +00:00
..
bundle.rs Make some ReflectComponent/ReflectBundle methods work with EntityMut too (#12895) 2024-04-08 01:46:07 +00:00
component.rs Make some ReflectComponent/ReflectBundle methods work with EntityMut too (#12895) 2024-04-08 01:46:07 +00:00
entity_commands.rs Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
from_world.rs fix some typos (#12038) 2024-02-22 18:55:22 +00:00
map_entities.rs Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
mod.rs Replace FromWorld requirement on ReflectResource and reflect Resource for State<S> (#12136) 2024-02-27 15:49:39 +00:00
resource.rs Replace FromWorld requirement on ReflectResource and reflect Resource for State<S> (#12136) 2024-02-27 15:49:39 +00:00