Struct amethyst::ecs::world::EntitiesRes [−]
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.
Methods
impl EntitiesRes
impl EntitiesRespub fn create(&self) -> Entity
pub fn create(&self) -> EntityCreates 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
pub fn create_iter(&self) -> CreateIterAtomicReturns an iterator which creates
new entities atomically.
They will be persistent as soon
as you call World::maintain.
pub fn build_entity(&self) -> EntityResBuilder
pub fn build_entity(&self) -> EntityResBuilderSimilar 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>
pub fn delete(&self, e: Entity) -> Result<(), WrongGeneration>Deletes an entity atomically.
The associated components will be
deleted as soon as you call World::maintain.
pub fn entity(&self, id: u32) -> Entity
pub fn entity(&self, id: u32) -> EntityReturns 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
pub fn is_alive(&self, e: Entity) -> boolReturns true if the specified entity is alive.
Trait Implementations
impl<'a> ParJoin for &'a EntitiesRes
impl<'a> ParJoin for &'a EntitiesResfn par_join(self) -> JoinParIter<Self>
fn par_join(self) -> JoinParIter<Self>Create a joined parallel iterator over the contents.
impl Default for EntitiesRes
impl Default for EntitiesResfn default() -> EntitiesRes
fn default() -> EntitiesResReturns the "default value" for a type. Read more
impl<'a> Join for &'a EntitiesRes
impl<'a> Join for &'a EntitiesRestype 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)
unsafe fn open(self) -> (<&'a EntitiesRes as Join>::Mask, &'a EntitiesRes)Open this join by returning the mask and the storages. Read more
unsafe fn get(v: &mut &'a EntitiesRes, idx: u32) -> Entity
unsafe fn get(v: &mut &'a EntitiesRes, idx: u32) -> EntityGet a joined component value by a given index.
ⓘImportant traits for JoinIter<J>fn join(self) -> JoinIter<Self>
fn join(self) -> JoinIter<Self>Create a joined iterator over the contents.
impl Debug for EntitiesRes
impl Debug for EntitiesResAuto Trait Implementations
impl Send for EntitiesRes
impl Send for EntitiesResimpl Sync for EntitiesRes
impl Sync for EntitiesRes