pub struct World {
pub camera: Camera,
/* private fields */
}Expand description
World - manages entities and provides system execution
Fields§
§camera: CameraImplementations§
Source§impl World
impl World
Sourcepub fn create_entity(&mut self) -> Option<Entity>
pub fn create_entity(&mut self) -> Option<Entity>
Create a new entity
Sourcepub fn destroy_entity(&mut self, entity: Entity)
pub fn destroy_entity(&mut self, entity: Entity)
Destroy an entity (note: components must be manually removed)
Sourcepub fn entity_count(&self) -> usize
pub fn entity_count(&self) -> usize
Get count of active entities
Sourcepub fn query<'a, T>(&'a self, storage: &'a ComponentStorage<T>) -> Query1<'a, T>where
T: Component,
pub fn query<'a, T>(&'a self, storage: &'a ComponentStorage<T>) -> Query1<'a, T>where
T: Component,
Query entities with one component type
Sourcepub fn query2<'a, T1, T2>(
&'a self,
storage1: &'a ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
) -> Query2<'a, T1, T2>
pub fn query2<'a, T1, T2>( &'a self, storage1: &'a ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, ) -> Query2<'a, T1, T2>
Query entities with two component types
Sourcepub fn query3<'a, T1, T2, T3>(
&'a self,
storage1: &'a ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
storage3: &'a ComponentStorage<T3>,
) -> Query3<'a, T1, T2, T3>
pub fn query3<'a, T1, T2, T3>( &'a self, storage1: &'a ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, storage3: &'a ComponentStorage<T3>, ) -> Query3<'a, T1, T2, T3>
Query entities with three component types
Sourcepub fn query4<'a, T1, T2, T3, T4>(
&'a self,
storage1: &'a ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
storage3: &'a ComponentStorage<T3>,
storage4: &'a ComponentStorage<T4>,
) -> Query4<'a, T1, T2, T3, T4>
pub fn query4<'a, T1, T2, T3, T4>( &'a self, storage1: &'a ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, storage3: &'a ComponentStorage<T3>, storage4: &'a ComponentStorage<T4>, ) -> Query4<'a, T1, T2, T3, T4>
Query entities with four component types
Sourcepub fn query_mut<'a, T>(
&'a self,
storage: &'a mut ComponentStorage<T>,
) -> Query1Mut<'a, T>where
T: Component,
pub fn query_mut<'a, T>(
&'a self,
storage: &'a mut ComponentStorage<T>,
) -> Query1Mut<'a, T>where
T: Component,
Query entities with one mutable component
Sourcepub fn query_1mut_1<'a, T1, T2>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
) -> Query1Mut1<'a, T1, T2>
pub fn query_1mut_1<'a, T1, T2>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, ) -> Query1Mut1<'a, T1, T2>
Query: 1 mutable, 1 immutable
Sourcepub fn query_1mut_2<'a, T1, T2, T3>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
storage3: &'a ComponentStorage<T3>,
) -> Query1Mut2<'a, T1, T2, T3>
pub fn query_1mut_2<'a, T1, T2, T3>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, storage3: &'a ComponentStorage<T3>, ) -> Query1Mut2<'a, T1, T2, T3>
Query: 1 mutable, 2 immutable
Sourcepub fn query_1mut_3<'a, T1, T2, T3, T4>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a ComponentStorage<T2>,
storage3: &'a ComponentStorage<T3>,
storage4: &'a ComponentStorage<T4>,
) -> Query1Mut3<'a, T1, T2, T3, T4>
pub fn query_1mut_3<'a, T1, T2, T3, T4>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a ComponentStorage<T2>, storage3: &'a ComponentStorage<T3>, storage4: &'a ComponentStorage<T4>, ) -> Query1Mut3<'a, T1, T2, T3, T4>
Query: 1 mutable, 3 immutable
Sourcepub fn query_2mut_1<'a, T1, T2, T3>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a mut ComponentStorage<T2>,
storage3: &'a ComponentStorage<T3>,
) -> Query2Mut1<'a, T1, T2, T3>
pub fn query_2mut_1<'a, T1, T2, T3>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a mut ComponentStorage<T2>, storage3: &'a ComponentStorage<T3>, ) -> Query2Mut1<'a, T1, T2, T3>
Query: 2 mutable, 1 immutable
Sourcepub fn query_2mut<'a, T1, T2>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a mut ComponentStorage<T2>,
) -> Query2Mut<'a, T1, T2>
pub fn query_2mut<'a, T1, T2>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a mut ComponentStorage<T2>, ) -> Query2Mut<'a, T1, T2>
Query: 2 mutable components
Sourcepub fn query_3mut<'a, T1, T2, T3>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a mut ComponentStorage<T2>,
storage3: &'a mut ComponentStorage<T3>,
) -> Query3Mut<'a, T1, T2, T3>
pub fn query_3mut<'a, T1, T2, T3>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a mut ComponentStorage<T2>, storage3: &'a mut ComponentStorage<T3>, ) -> Query3Mut<'a, T1, T2, T3>
Query: 3 mutable components
Sourcepub fn query_4mut<'a, T1, T2, T3, T4>(
&'a self,
storage1: &'a mut ComponentStorage<T1>,
storage2: &'a mut ComponentStorage<T2>,
storage3: &'a mut ComponentStorage<T3>,
storage4: &'a mut ComponentStorage<T4>,
) -> Query4Mut<'a, T1, T2, T3, T4>
pub fn query_4mut<'a, T1, T2, T3, T4>( &'a self, storage1: &'a mut ComponentStorage<T1>, storage2: &'a mut ComponentStorage<T2>, storage3: &'a mut ComponentStorage<T3>, storage4: &'a mut ComponentStorage<T4>, ) -> Query4Mut<'a, T1, T2, T3, T4>
Query: 4 mutable components
Auto Trait Implementations§
impl Freeze for World
impl RefUnwindSafe for World
impl Send for World
impl Sync for World
impl Unpin for World
impl UnwindSafe for World
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