pub struct Entities { /* private fields */ }Expand description
Implementations§
Source§impl Entities
impl Entities
Sourcepub fn alive_iter(&self) -> impl Iterator<Item = Entity> + '_
pub fn alive_iter(&self) -> impl Iterator<Item = Entity> + '_
Return an iterator over all alive entities.
Sourcepub fn create_many(&mut self, how_many: usize) -> Vec<usize>
pub fn create_many(&mut self, how_many: usize) -> Vec<usize>
Create many entities at once, returning a list of their ids.
An Entity can be made from its usize id using Entities::hydrate.
Sourcepub fn destroy(&self, entity: Entity)
pub fn destroy(&self, entity: Entity)
Lazily destroy an entity, removing its components and recycling it at the end of this tick.
§NOTE:
Destroyed entities will have their components removed
automatically during upkeep, which happens each World::tick_lazy.
Sourcepub fn destroy_all(&mut self)
pub fn destroy_all(&mut self)
Destroys all entities.
Sourcepub fn deleted_iter(&self) -> impl Iterator<Item = Entry<()>> + '_
pub fn deleted_iter(&self) -> impl Iterator<Item = Entry<()>> + '_
Produce an iterator of deleted entities as entries.
This iterator should be filtered at the callsite for the latest changed entries since a stored iteration timestamp.
Sourcepub fn deleted_iter_of<T: 'static>(
&self,
) -> impl Iterator<Item = Entry<()>> + '_
pub fn deleted_iter_of<T: 'static>( &self, ) -> impl Iterator<Item = Entry<()>> + '_
Produce an iterator of deleted entities that had a component of the given type, as entries.
This iterator should be filtered at the callsite for the latest changed entries since a stored iteration timestamp.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Entities
impl RefUnwindSafe for Entities
impl Send for Entities
impl Sync for Entities
impl Unpin for Entities
impl UnwindSafe for Entities
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more