Struct rin::ecs::WriteAndParent[][src]

pub struct WriteAndParent<'a, T> where
    T: Component
{ /* fields omitted */ }

Operator over hierarchical components that will select an entity’s component and it’s parent for read and write

for (pos, parent_pos) in entities.ordered_iter_for_mut::<WriteAndParent<Position>>(){
    if let Some(parent_pos) = parent_pos {
        pos.x += parent_pos.x;
        pos.y += parent_pos.y;
    }
}

Will accumulate the positions of each object to that of their parents so in the end i’ll object will end up with the absolute position in the world

Trait Implementations

impl<'a, T> ChangesOrderedData<'a> for WriteAndParent<'a, T> where
    T: ComponentSend,
    <T as Component>::Storage: for<'b> HierarchicalStorage<'b, T>,
    WriteGuardRef<'b, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: for<'b> IntoOrderedIterMut,
    WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: IntoOrderedChangesIter<'a, T>,
    <WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard> as IntoOrderedChangesIter<'a, T>>::OrderedChangesItem == NodeRefMut<'a, T>, 
[src]

type SubStorage = ParentStorageWrite<'a, <WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard> as IntoOrderedChangesIter<'a, T>>::RawSubStorage, <WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard> as IntoOrderedChangesIter<'a, T>>::SubStorage, <WriteAndParent<'a, T> as OrderedData<'a>>::Components>

impl<'a, T> OrderedData<'a> for WriteAndParent<'a, T> where
    T: Component,
    <T as Component>::Storage: for<'b> HierarchicalStorage<'b, T>,
    WriteGuardRef<'b, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: for<'b> IntoOrderedIterMut
[src]

type Iter = WriteAndParentIter<'a, T, <WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard> as IntoOrderedIterMut>::OrderedIterMut>

type Components = T

type ComponentsRef = (&'a mut T, Option<&'a T>)

type Storage = ParentStorageWrite<'a, <T as Component>::Storage, WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>, <WriteAndParent<'a, T> as OrderedData<'a>>::Components>

impl<'_, '_, T> SafeIter<'_> for WriteAndParent<'_, T> where
    T: Component
[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for WriteAndParent<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for WriteAndParent<'a, T> where
    T: Sync

impl<'a, T> Sync for WriteAndParent<'a, T> where
    T: Sync

impl<'a, T> Unpin for WriteAndParent<'a, T>

impl<'a, T> UnwindSafe for WriteAndParent<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

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

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

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]