bevy/crates/bevy_ecs/src
Nicola Papale 019432af2e
Add get_ref to EntityRef (#8818)
# Objective

To mirror the `Ref` added as `WorldQuery`, and the `Mut` in
`EntityMut::get_mut`, we add `EntityRef::get_ref`, which retrieves `T`
with tick information, but *immutably*.

## Solution

- Add the method in question, also add it to`UnsafeEntityCell` since
this seems to be the best way of getting that information.

Also update/add safety comments to neighboring code.

---

## Changelog

- Add `EntityRef::get_ref` to get an `Option<Ref<T>>` from `EntityRef`

---------

Co-authored-by: James Liu <contact@jamessliu.com>
2023-06-13 08:47:55 +00:00
..
entity Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
query Require read-only queries in QueryState::par_iter (#8832) 2023-06-13 01:17:40 +00:00
schedule Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
storage Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
system Implement Clone for CombinatorSystem (#8826) 2023-06-12 19:44:51 +00:00
world Add get_ref to EntityRef (#8818) 2023-06-13 08:47:55 +00:00
archetype.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
bundle.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
change_detection.rs Allow unsized types as mapped value in Ref::map (#8817) 2023-06-12 17:52:11 +00:00
component.rs Add last_changed_tick and added_tick to ComponentTicks (#8803) 2023-06-12 17:55:09 +00:00
event.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
lib.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
reflect.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
removal_detection.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00