[][src]Struct orbtk::StringComponentStore

pub struct StringComponentStore { /* fields omitted */ }

The StringComponentStore stores the components of entities and uses strings as component keys. It could be used to borrow the components of the entities.

Methods

impl StringComponentStore[src]

pub fn register<C>(
    &mut self,
    key: impl Into<String>,
    entity: Entity,
    component: C
) where
    C: Component
[src]

Register a component for the given entity.

pub fn register_shared<C>(&mut self, key: &str, target: Entity, source: Entity) where
    C: Component
[src]

Registers a sharing of the given component between the given entities. Uses as source key the component key.

pub fn register_shared_by_source_key<C>(
    &mut self,
    key: &str,
    source_key: &str,
    target: Entity,
    source: Entity
) where
    C: Component
[src]

Registers a sharing of the given component between the given entities.

pub fn register_shared_box(
    &mut self,
    key: &str,
    target: Entity,
    source: SharedComponentBox
)
[src]

Registers a sharing of the given component between the given entities. Uses as source key the component key.

pub fn register_shared_box_by_source_key(
    &mut self,
    key: &str,
    source_key: &str,
    target: Entity,
    source: SharedComponentBox
)
[src]

Registers a sharing of the given component between the given entities.

pub fn register_box(
    &mut self,
    key: &str,
    entity: Entity,
    component_box: ComponentBox
)
[src]

Register a component_box for the given entity.

pub fn len(&self) -> usize[src]

Returns the number of components in the store.

pub fn is_empty(&self) -> bool[src]

Returns true if the components are empty.

pub fn contains_entity(&self, entity: Entity) -> bool[src]

Returns true if the store contains the specific entity.

pub fn is_origin<C>(&self, key: &str, entity: Entity) -> bool where
    C: Component
[src]

Returns true if entity is the origin of the requested component false.

pub fn get<C>(&self, key: &str, entity: Entity) -> Result<&C, NotFound> where
    C: Component
[src]

Returns a reference of a component of type C from the given entity. If the entity does not exists or it doesn't have a component of type C NotFound will be returned.

pub fn get_mut<C>(
    &mut self,
    key: &str,
    entity: Entity
) -> Result<&mut C, NotFound> where
    C: Component
[src]

Returns a mutable reference of a component of type C from the given entity. If the entity does not exists or it doesn't have a component of type C NotFound will be returned.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

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

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> SetParameter for T