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]
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>
fn extend_changes<F, E: EntitiesStorage>(entities: &'a E, f: F) where
F: FnMut(Self::ComponentsRef) -> bool,
[src]
F: FnMut(Self::ComponentsRef) -> bool,
unsafe fn storage_and_changes<E: EntitiesStorage>(
entities: &'a E
) -> Option<(Self::SubStorage, &'a mut HashSet<usize>)>
[src]
entities: &'a E
) -> Option<(Self::SubStorage, &'a mut HashSet<usize>)>
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]
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>
fn query_mask<E: EntitiesStorage>(entities: &E) -> Bitmask
[src]
fn into_iter<E: EntitiesStorage>(entities: &'a E) -> Self::Iter
[src]
fn storage<E: EntitiesStorage>(entities: &'a E) -> Option<Self::Storage>
[src]
fn ordered_ids<S: FastIndexExt, E: EntitiesStorage>(
entities: &'a E,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'a>
[src]
entities: &'a E,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'a>
impl<T: Component> SafeIter<'_> for WriteAndParent<'_, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for WriteAndParent<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for WriteAndParent<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for WriteAndParent<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for WriteAndParent<'a, T>
impl<'a, T> UnwindSafe for WriteAndParent<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,