Struct planck_ecs::Entities [−][src]
pub struct Entities { /* fields omitted */ }
Expand description
Holds a list of alive entities. It also holds a list of entities that were recently killed, which allows to remove components of deleted entities at the end of a game frame.
Implementations
impl Entities
[src]
impl Entities
[src]pub fn create(&mut self) -> Entity
[src]
pub fn create(&mut self) -> Entity
[src]Creates a new Entity
and returns it.
This function will not reuse the index of an entity that is still in
the killed entities.
pub fn is_alive(&self, entity: Entity) -> bool
[src]
pub fn is_alive(&self, entity: Entity) -> bool
[src]Checks if the Entity
is still alive.
Returns true if it is alive.
Returns false if it has been killed.
pub fn clear_killed(&mut self)
[src]
pub fn clear_killed(&mut self)
[src]Clears the killed entity list.
pub fn bitset(&self) -> &Vec<[u32; 8], Global>
[src]
pub fn bitset(&self) -> &Vec<[u32; 8], Global>
[src]Returns a bitset where each index where the bit is set to 1 indicates
the index of an alive entity.
Useful for joining over Entity
and Component<T>
at the same time.
pub fn iter_with_bitset(
&'a self,
bitset: Rc<Vec<[u32; 8], Global>>
) -> EntityIterator<'a>ⓘNotable traits for EntityIterator<'a>
impl<'a> Iterator for EntityIterator<'a> type Item = Option<Entity>;
[src]
pub fn iter_with_bitset(
&'a self,
bitset: Rc<Vec<[u32; 8], Global>>
) -> EntityIterator<'a>ⓘNotable traits for EntityIterator<'a>
impl<'a> Iterator for EntityIterator<'a> type Item = Option<Entity>;
[src]Iterates over entities using the provided bitset.
Trait Implementations
Auto Trait Implementations
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 T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more