Struct entity_component::Entities [−][src]
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]
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]
Checks if the Entity
is still alive.
Returns true if it is alive.
Returns false if it has been killed.
pub fn kill(&mut self, entity: Entity)
[src]
Kill an entity.
pub fn killed(&self) -> &Vec<Entity>
[src]
Returns entities in the killed list.
pub fn clear_killed(&mut self)
[src]
Clears the killed entity list.
pub fn bitset(&self) -> &BitSetVec
[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>(
&'a self,
bitset: Rc<BitSetVec>
) -> EntityIterator<'a>ⓘNotable traits for EntityIterator<'a>
impl<'a> Iterator for EntityIterator<'a> type Item = Option<Entity>;
[src]
&'a self,
bitset: Rc<BitSetVec>
) -> EntityIterator<'a>ⓘ
Notable traits for EntityIterator<'a>
impl<'a> Iterator for EntityIterator<'a> type Item = Option<Entity>;
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,