Struct ark_api::world::EntityArena
source · [−]pub struct EntityArena { /* private fields */ }
Expand description
An EntityArena
is a collection for holding on to entities. Use it to keep track of sets of entities
A global arena exists in which entities can be created and cloned
Implementations
sourceimpl EntityArena
impl EntityArena
sourcepub fn insert(&mut self, entity: EntityOwned) -> Entity
pub fn insert(&mut self, entity: EntityOwned) -> Entity
Adds an owned entity to the arena
sourcepub fn remove(&mut self, entity: Entity) -> Option<EntityOwned>
pub fn remove(&mut self, entity: Entity) -> Option<EntityOwned>
Removes an entity from the arena using the entity handle, If the entity was in the arena it is returned, otherwise None.
sourcepub fn schedule_for_destruction(&mut self, entity: Entity) -> Option<Entity>
pub fn schedule_for_destruction(&mut self, entity: Entity) -> Option<Entity>
Schedules an entity for destruction using the entity handle,
Will be destroyed on the next call to destroy_pending_entities
.
If the entity is in the arena a handle to it is returned, otherwise None.
sourcepub fn destroy_pending_entities(&mut self)
pub fn destroy_pending_entities(&mut self)
Destroys all entities that have been scheduled for destruction using the
schedule_for_destruction
function.
sourcepub fn destroy_all(&mut self)
pub fn destroy_all(&mut self)
Destroys all entities in the arena
sourcepub fn global() -> &'static mut Self
pub fn global() -> &'static mut Self
Returns the global entity arena, used by Entity::create
functions
Trait Implementations
sourceimpl Default for EntityArena
impl Default for EntityArena
sourcefn default() -> EntityArena
fn default() -> EntityArena
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for EntityArena
impl Send for EntityArena
impl Sync for EntityArena
impl Unpin for EntityArena
impl UnwindSafe for EntityArena
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more