Struct amethyst_ecs::World
[−]
[src]
pub struct World { /* fields omitted */ }
A collection of entities and their respective components.
Methods
impl World
[src]
fn new() -> World
Creates a new empty world.
fn create_entity(&mut self) -> Entity
Creates a new entity in the world and returns a handle to it.
fn destroy_entity(&mut self, entity: Entity)
Destroys a given entity and removes its components.
fn insert_component<T: Any>(&mut self, entity: Entity, comp: T) -> Option<usize>
Attaches a component to an entity and returns the component's index.
fn remove_component<T: Any>(&mut self, entity: Entity)
fn remove_component_type(&mut self, t: TypeId, entity: Entity)
fn component<T: Any>(&self, index: usize) -> Option<&(Entity, T)>
Returns ith component of selected type
fn component_mut<T: Any>(&mut self, index: usize) -> Option<&mut (Entity, T)>
Returns ith mutable component of selected type