Trait oxygengine_core::ecs::storage::GenericWriteStorage [−][src]
pub trait GenericWriteStorage {
type Component: Component;
fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>;
fn get_mut_or_default(
&mut self,
entity: Entity
) -> Option<&mut Self::Component>
where
Self::Component: Default;
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> Result<Option<Self::Component>, Error>;
fn remove(&mut self, entity: Entity);
fn _private() -> Seal;
}Expand description
Provides generic write access to WriteStorage, both as a value and a
mutable reference.
Associated Types
Required methods
Get mutable access to an Entitys component
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.
Insert a component for an Entity
Implementors
impl<'a, 'b, T> GenericWriteStorage for &'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
'a: 'b,
T: Component, [src]
impl<'a, 'b, T> GenericWriteStorage for &'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
'a: 'b,
T: Component, [src]type Component = Tpub fn get_mut(
&mut self,
entity: Entity
) -> Option<&mut <&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>[src]pub fn get_mut_or_default(
&mut self,
entity: Entity
) -> Option<&mut <&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component> where
<&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component: Default, [src]pub fn insert(
&mut self,
entity: Entity,
comp: <&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component
) -> Result<Option<<&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>, Error>[src]impl<'a, T> GenericWriteStorage for Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
T: Component, [src]
impl<'a, T> GenericWriteStorage for Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
T: Component, [src]type Component = Tpub fn get_mut(
&mut self,
entity: Entity
) -> Option<&mut <Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>[src]pub fn get_mut_or_default(
&mut self,
entity: Entity
) -> Option<&mut <Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component> where
<Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component: Default, [src]pub fn insert(
&mut self,
entity: Entity,
comp: <Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component
) -> Result<Option<<Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>, Error>[src]