[][src]Struct dces::world::World

pub struct World<T> where
    T: EntityContainer
{ /* fields omitted */ }

The World struct represents the main interface of the library. It used as storage of entities, components and systems.

Methods

impl<T> World<T> where
    T: EntityContainer
[src]

pub fn new() -> World<VecEntityContainer>
[src]

Creates a new world the a vector based entity container.

pub fn from_container(entity_container: T) -> Self
[src]

Creates a new world from the given container.

pub fn entity_container(&mut self) -> &mut T
[src]

Returns a mutable reference of the entity container.

pub fn create_entity(&mut self) -> EntityBuilder<T>
[src]

Creates a new entity and returns a returns an EntityBuilder.

pub fn remove_entity(&mut self, entity: Entity)
[src]

Deletes the given entity.

pub fn register_init_system(
    &mut self,
    init_system: impl System<T>
)
[src]

Registers the init system.

pub fn register_cleanup_system(
    &mut self,
    cleanup_system: impl System<T>
)
[src]

Registers the cleanup system.

pub fn create_system(
    &mut self,
    system: impl System<T>
) -> EntitySystemBuilder<T>
[src]

Creates a new entity system and returns a returns an EntitySystemBuilder.

pub fn remove_system(&mut self, system_id: u32)
[src]

Removes the given entity.

pub fn entity_component_manager(&mut self) -> &mut EntityComponentManager
[src]

Borrows mutable the entity component manager.

pub fn run(&mut self)
[src]

Run all systems of the world.

Trait Implementations

impl<T: Default> Default for World<T> where
    T: EntityContainer
[src]

impl<T> Send for World<T> where
    T: EntityContainer
[src]

impl<T> Drop for World<T> where
    T: EntityContainer
[src]

Auto Trait Implementations

impl<T> !Sync for World<T>

Blanket Implementations

impl<T> Component for T where
    T: Any
[src]

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.