Struct oxygengine_core::ecs::world::EntitiesRes [−][src]
pub struct EntitiesRes { /* fields omitted */ }
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.
Implementations
impl EntitiesRes
[src]
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.
pub fn create_iter(&self) -> CreateIterAtomic<'_>ⓘNotable traits for CreateIterAtomic<'a>
impl<'a> Iterator for CreateIterAtomic<'a> type Item = Entity;
[src]
Notable traits for CreateIterAtomic<'a>
impl<'a> Iterator for CreateIterAtomic<'a> type Item = Entity;
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 Default for EntitiesRes
[src]
impl Default for EntitiesRes
[src]pub fn default() -> EntitiesRes
[src]
impl<'a> Join for &'a EntitiesRes
[src]
impl<'a> Join for &'a EntitiesRes
[src]type Mask = BitSetOr<&'a BitSet, &'a AtomicBitSet>
Type of joined bit mask.
type Type = Entity
Type of joined components.
type Value = &'a EntitiesRes
Type of joined storages.
pub unsafe fn open(self) -> (<&'a EntitiesRes as Join>::Mask, &'a EntitiesRes)
[src]
pub unsafe fn get(v: &mut &'a EntitiesRes, idx: u32) -> Entity
[src]
pub fn join(self) -> JoinIter<Self>ⓘ
[src]
pub fn maybe(self) -> MaybeJoin<Self>
[src]
pub fn is_unconstrained() -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for EntitiesRes
impl RefUnwindSafe for EntitiesRes
impl Send for EntitiesRes
impl Send for EntitiesRes
impl Sync for EntitiesRes
impl Sync for EntitiesRes
impl Unpin for EntitiesRes
impl Unpin for EntitiesRes
impl UnwindSafe for EntitiesRes
impl UnwindSafe for EntitiesRes
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
impl<T> TryDefault for T where
T: Default,
[src]
impl<T> TryDefault for T where
T: Default,
[src]