[−]Trait oxygengine::core::ecs::storage::GenericWriteStorage
Provides generic write access to WriteStorage
, both as a value and a
mutable reference.
Associated Types
Loading content...Required methods
fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>
Get mutable access to an Entity
s component
fn get_mut_or_default(&mut self, entity: Entity) -> Option<&mut Self::Component> where
Self::Component: Default,
Self::Component: Default,
Get mutable access to an Entity
s component. If the component does not
exist, it is automatically created using Default::default()
.
Returns None if the entity is dead.
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> Result<Option<Self::Component>, Error>
&mut self,
entity: Entity,
comp: Self::Component
) -> Result<Option<Self::Component>, Error>
Insert a component for an Entity
fn remove(&mut self, entity: Entity)
Remove the component for an Entity
fn _private() -> Seal
Private function to seal the trait
Implementors
impl<'a, 'b, T> GenericWriteStorage for &'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
'a: 'b,
T: Component,
'a: 'b,
T: Component,
type Component = T
fn get_mut(
&mut self,
entity: Entity
) -> Option<&mut <&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>
&mut self,
entity: Entity
) -> Option<&mut <&'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>
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,
&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,
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>
&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>
fn remove(&mut self, entity: Entity)
fn _private() -> Seal
impl<'a, T> GenericWriteStorage for Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> where
T: Component,
T: Component,
type Component = T
fn get_mut(
&mut self,
entity: Entity
) -> Option<&mut <Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>
&mut self,
entity: Entity
) -> Option<&mut <Storage<'a, T, FetchMut<'a, MaskedStorage<T>>> as GenericWriteStorage>::Component>
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,
&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,
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>
&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>