fix scenes test
This commit is contained in:
parent
b415dc8325
commit
38a97105a4
@ -82,6 +82,12 @@ impl<'w> EntityRef<'w> {
|
||||
self.cell.location()
|
||||
}
|
||||
|
||||
/// Returns if the entity is constructed or not.
|
||||
#[inline]
|
||||
pub fn is_constructed(&self) -> bool {
|
||||
self.cell.location().is_some()
|
||||
}
|
||||
|
||||
/// Returns the archetype that the current entity belongs to.
|
||||
#[inline]
|
||||
pub fn archetype(&self) -> Option<&Archetype> {
|
||||
@ -492,6 +498,12 @@ impl<'w> EntityMut<'w> {
|
||||
self.cell.location()
|
||||
}
|
||||
|
||||
/// Returns if the entity is constructed or not.
|
||||
#[inline]
|
||||
pub fn is_constructed(&self) -> bool {
|
||||
self.cell.location().is_some()
|
||||
}
|
||||
|
||||
/// Returns the archetype that the current entity belongs to.
|
||||
#[inline]
|
||||
pub fn archetype(&self) -> Option<&Archetype> {
|
||||
@ -1220,7 +1232,7 @@ impl<'w> EntityWorldMut<'w> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns whether or not the entity is constructed.
|
||||
/// Returns if the entity is constructed or not.
|
||||
#[inline]
|
||||
pub fn is_constructed(&self) -> bool {
|
||||
self.location.is_some()
|
||||
@ -3277,6 +3289,12 @@ impl<'w> FilteredEntityRef<'w> {
|
||||
self.entity.location()
|
||||
}
|
||||
|
||||
/// Returns if the entity is constructed or not.
|
||||
#[inline]
|
||||
pub fn is_constructed(&self) -> bool {
|
||||
self.entity.location().is_some()
|
||||
}
|
||||
|
||||
/// Returns the archetype that the current entity belongs to.
|
||||
#[inline]
|
||||
pub fn archetype(&self) -> Option<&Archetype> {
|
||||
@ -3619,6 +3637,12 @@ impl<'w> FilteredEntityMut<'w> {
|
||||
self.entity.location()
|
||||
}
|
||||
|
||||
/// Returns if the entity is constructed or not.
|
||||
#[inline]
|
||||
pub fn is_constructed(&self) -> bool {
|
||||
self.entity.location().is_some()
|
||||
}
|
||||
|
||||
/// Returns the archetype that the current entity belongs to.
|
||||
#[inline]
|
||||
pub fn archetype(&self) -> Option<&Archetype> {
|
||||
|
@ -774,7 +774,10 @@ mod tests {
|
||||
assert!(dst_world
|
||||
.query_filtered::<&MyEntityRef, With<Foo>>()
|
||||
.iter(&dst_world)
|
||||
.all(|r| world.get_entity(r.0).is_err()));
|
||||
.all(|r| world
|
||||
.get_entity(r.0)
|
||||
.map(|entity| !entity.is_constructed())
|
||||
.unwrap_or(true)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user