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]
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>
pub fn extend_changes<F, E>(entities: &'a E, f: F) where
E: EntitiesStorage,
F: FnMut(<WriteAndParent<'a, T> as OrderedData<'a>>::ComponentsRef) -> bool,
[src]
E: EntitiesStorage,
F: FnMut(<WriteAndParent<'a, T> as OrderedData<'a>>::ComponentsRef) -> bool,
pub unsafe fn storage_and_changes<E>(
entities: &'a E
) -> Option<(<WriteAndParent<'a, T> as ChangesOrderedData<'a>>::SubStorage, &'a mut HashSet<usize, RandomState>)> where
E: EntitiesStorage,
[src]
entities: &'a E
) -> Option<(<WriteAndParent<'a, T> as ChangesOrderedData<'a>>::SubStorage, &'a mut HashSet<usize, RandomState>)> where
E: EntitiesStorage,
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]
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>
pub fn query_mask<E>(entities: &E) -> Bitmask where
E: EntitiesStorage,
[src]
E: EntitiesStorage,
pub fn into_iter<E>(
entities: &'a E
) -> <WriteAndParent<'a, T> as OrderedData<'a>>::Iter where
E: EntitiesStorage,
[src]
entities: &'a E
) -> <WriteAndParent<'a, T> as OrderedData<'a>>::Iter where
E: EntitiesStorage,
pub fn storage<E>(
entities: &'a E
) -> Option<<WriteAndParent<'a, T> as OrderedData<'a>>::Storage> where
E: EntitiesStorage,
[src]
entities: &'a E
) -> Option<<WriteAndParent<'a, T> as OrderedData<'a>>::Storage> where
E: EntitiesStorage,
pub fn ordered_ids<S, E>(
entities: &'a E,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'a> where
E: EntitiesStorage,
S: FastIndexExt,
[src]
entities: &'a E,
query_mask: Bitmask,
unordered_storage: &S
) -> OrderedIndexGuard<'a> where
E: EntitiesStorage,
S: FastIndexExt,
impl<'_, '_, T> SafeIter<'_> for WriteAndParent<'_, T> where
T: Component,
[src]
T: Component,
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,
Blanket Implementations
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]