Struct rs_ecs::World [−][src]
pub struct World { /* fields omitted */ }
Expand description
The ECS world storing Entities and components.
Implementations
impl World
[src]
impl World
[src]impl World
[src]
impl World
[src]impl World
[src]
impl World
[src]pub fn get<C>(&self, ent: Entity) -> Option<Comp<'_, C>> where
C: 'static,
[src]
pub fn get<C>(&self, ent: Entity) -> Option<Comp<'_, C>> where
C: 'static,
[src]Get an immutable reference to the component of the given type for an Entity.
Note that for repeated calls, map can be used to amortize the set-up costs.
Example
let mut world = World::new(); let entity = world.alloc(); world.insert(entity, (42_u32, true)); let comp = world.get::<u32>(entity).unwrap();
pub fn get_mut<C>(&self, ent: Entity) -> Option<CompMut<'_, C>> where
C: 'static,
[src]
pub fn get_mut<C>(&self, ent: Entity) -> Option<CompMut<'_, C>> where
C: 'static,
[src]Get a mutable reference to the component of the given type for an Entity.
Note that for repeated calls, map can be used to amortize the set-up costs.
Example
let mut world = World::new(); let entity = world.alloc(); world.insert(entity, (42_u32, true)); let comp = world.get_mut::<u32>(entity).unwrap();