Struct rinecs::operators::WriteAndParent[][src]

pub struct WriteAndParent<'a, 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: ComponentSend> ChangesOrderedData<'a> for WriteAndParent<'a, T> where
    <T as Component>::Storage: HierarchicalStorage<'b, T>,
    WriteGuardRef<'b, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: IntoOrderedIterMut,
    WriteGuardRef<'a, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: 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, Self::Components>

impl<'a, T: Component> OrderedData<'a> for WriteAndParent<'a, T> where
    <T as Component>::Storage: HierarchicalStorage<'b, T>,
    WriteGuardRef<'b, <T as Component>::Storage, <T as Component>::MutStorageCacheGuard>: 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>, Self::Components>

impl<T: Component> SafeIter<'_> for WriteAndParent<'_, T>[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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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.