Trait oxygengine_core::ecs::storage::GenericWriteStorage[][src]

pub trait GenericWriteStorage {
    type Component: Component;
    pub fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>;
pub fn get_mut_or_default(
        &mut self,
        entity: Entity
    ) -> Option<&mut Self::Component>
    where
        Self::Component: Default
;
pub fn insert(
        &mut self,
        entity: Entity,
        comp: Self::Component
    ) -> Result<Option<Self::Component>, Error>;
pub fn remove(&mut self, entity: Entity);
pub fn _private() -> Seal; }

Provides generic write access to WriteStorage, both as a value and a mutable reference.

Associated Types

type Component: Component[src]

The component type of the storage

Loading content...

Required methods

pub fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>[src]

Get mutable access to an Entitys component

pub fn get_mut_or_default(
    &mut self,
    entity: Entity
) -> Option<&mut Self::Component> where
    Self::Component: Default
[src]

Get mutable access to an Entitys component. If the component does not exist, it is automatically created using Default::default().

Returns None if the entity is dead.

pub fn insert(
    &mut self,
    entity: Entity,
    comp: Self::Component
) -> Result<Option<Self::Component>, Error>
[src]

Insert a component for an Entity

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

Remove the component for an Entity

pub fn _private() -> Seal[src]

Private function to seal the trait

Loading content...

Implementors

impl<'a, 'b, T> GenericWriteStorage for &'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
    'a: 'b,
    T: Component
[src]

type Component = T

impl<'a, T> GenericWriteStorage for Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
    T: Component
[src]

type Component = T

Loading content...