[−][src]Struct oxygengine_core::ecs::world::EntitiesRes
The entities of this ECS. This is a resource, stored in the World.
If you just want to access it in your system, you can also use the Entities
type def.
Please note that you should never get this mutably in a system, because it would block all the other systems.
You need to call World::maintain after creating / deleting
entities with this struct.
Methods
impl EntitiesRes[src]
pub fn create(&self) -> Entity[src]
Creates a new entity atomically.
This will be persistent as soon
as you call World::maintain.
If you want a lazy entity builder, take a look
at LazyUpdate::create_entity.
In case you have access to the World,
you can also use World::create_entity which
creates the entity and the components immediately.
ⓘImportant traits for CreateIterAtomic<'a>pub fn create_iter(&self) -> CreateIterAtomic[src]
Returns an iterator which creates
new entities atomically.
They will be persistent as soon
as you call World::maintain.
pub fn build_entity(&self) -> EntityResBuilder[src]
Similar to the create method above this
creates an entity atomically, and then returns a
builder which can be used to insert components into
various storages if available.
pub fn delete(&self, e: Entity) -> Result<(), WrongGeneration>[src]
Deletes an entity atomically.
The associated components will be
deleted as soon as you call World::maintain.
pub fn entity(&self, id: u32) -> Entity[src]
Returns an entity with a given id. There's no guarantee for validity,
meaning the entity could be not alive.
pub fn is_alive(&self, e: Entity) -> bool[src]
Returns true if the specified entity is alive.
Trait Implementations
impl<'a> Join for &'a EntitiesRes[src]
type Type = Entity
Type of joined components.
type Value = &'a EntitiesRes
Type of joined storages.
type Mask = BitSetOr<&'a BitSet, &'a AtomicBitSet>
Type of joined bit mask.
unsafe fn open(self) -> (<&'a EntitiesRes as Join>::Mask, &'a EntitiesRes)[src]
unsafe fn get(v: &mut &'a EntitiesRes, idx: u32) -> Entity[src]
ⓘImportant traits for JoinIter<J>fn join(self) -> JoinIter<Self>[src]
Create a joined iterator over the contents.
fn maybe(self) -> MaybeJoin<Self>[src]
Returns a Join-able structure that yields all indices, returning None for all missing elements and Some(T) for found elements. Read more
fn is_unconstrained() -> bool[src]
If this Join typically returns all indices in the mask, then iterating over only it or combined with other joins that are also dangerous will cause the JoinIter/ParJoin to go through all indices which is usually not what is wanted and will kill performance. Read more
impl Default for EntitiesRes[src]
fn default() -> EntitiesRes[src]
impl Debug for EntitiesRes[src]
Auto Trait Implementations
impl Sync for EntitiesRes
impl Send for EntitiesRes
impl Unpin for EntitiesRes
impl RefUnwindSafe for EntitiesRes
impl UnwindSafe for EntitiesRes
Blanket Implementations
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> TryDefault for T where
T: Default, [src]
T: Default,
fn try_default() -> Result<T, String>[src]
fn unwrap_default() -> Self[src]
Calls try_default and panics on an error case.
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,