pub struct EntityStorage {
pub ecs: World,
/* private fields */
}
Fields§
§ecs: World
The ECS storing all entities in the level.
Implementations§
Source§impl EntityStorage
impl EntityStorage
Sourcepub unsafe fn spawn_entity_unchecked(
&mut self,
entity_type: &'static EntityType,
pos: EntityPos,
) -> Entity
pub unsafe fn spawn_entity_unchecked( &mut self, entity_type: &'static EntityType, pos: EntityPos, ) -> Entity
Spawn an entity in the level owning this storage, you must give its type and position,
its handle is returned. If the given entity type is not supported by the level’s
environment, None
is returned.
§Safety:
This method is made for internal use because the entity type must be supported checked to be supported by level’s environment. The returned entity handle must also be added in the the associated chunk if existing.
§See:
Use Level::spawn_entity
instead of this method if you want to avoid safety issues.
Sourcepub unsafe fn add_entity_unchecked(
&mut self,
entity_builder: &mut EntityBuilder,
) -> Entity
pub unsafe fn add_entity_unchecked( &mut self, entity_builder: &mut EntityBuilder, ) -> Entity
Add a raw entity from a builder, this method is unsafe because the caller must ensure
that the builder contains a BaseEntity
component with an entity
pub fn remove_entity(&mut self, entity: Entity) -> bool
pub fn get_entity_ref(&self, entity: Entity) -> Option<EntityRef<'_>>
Auto Trait Implementations§
impl !Freeze for EntityStorage
impl RefUnwindSafe for EntityStorage
impl Send for EntityStorage
impl Sync for EntityStorage
impl Unpin for EntityStorage
impl UnwindSafe for EntityStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more