[][src]Struct orbtk::prelude::World

pub struct World<E, C, Ctx> where
    C: ComponentStore,
    E: EntityStore
{ /* fields omitted */ }

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

Implementations

impl<E, C, Ctx> World<E, C, Ctx> where
    C: ComponentStore,
    E: EntityStore
[src]

pub fn from_stores(entity_store: E, component_store: C) -> World<E, C, Ctx>[src]

Creates a new world from the given container.

pub fn create_entity(&mut self) -> EntityBuilder<'_, E, C>[src]

Creates a new entity and returns a returns an TypeEntityBuilder.

pub fn remove_entity(&mut self, entity: impl Into<Entity>)[src]

Deletes the given entity.

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

Registers the init system.

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

Registers the cleanup system.

pub fn create_system(
    &mut self,
    system: impl System<E, C, Ctx>
) -> SystemStoreBuilder<'_, E, C, Ctx>
[src]

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

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

Removes the given entity.

pub fn entity_component_manager(&mut self) -> &mut EntityComponentManager<E, C>[src]

Borrows mutable the entity component manager.

pub fn print_entity(&self, entity: impl Into<Entity>)[src]

Print infos about the given entity.

pub fn run(&mut self)[src]

Run all systems of the world.

pub fn run_with_context(&mut self, ctx: &mut Ctx)[src]

Run all systems of the world and calls run_with_context of the systems with the given context.

Trait Implementations

impl<E, C, Ctx> Drop for World<E, C, Ctx> where
    C: ComponentStore,
    E: EntityStore
[src]

impl<E, C, Ctx> Send for World<E, C, Ctx> where
    C: ComponentStore,
    E: EntityStore
[src]

Auto Trait Implementations

impl<E, C, Ctx> !RefUnwindSafe for World<E, C, Ctx>

impl<E, C, Ctx> !Sync for World<E, C, Ctx>

impl<E, C, Ctx> Unpin for World<E, C, Ctx> where
    C: Unpin,
    E: Unpin

impl<E, C, Ctx> !UnwindSafe for World<E, C, Ctx>

Blanket Implementations

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

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

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

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

impl<T> From<T> for T[src]

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

impl<T> SetParameter for T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,