Struct shard_ecs::archetype_registry::ArchetypeRegistry
source · pub struct ArchetypeRegistry { /* private fields */ }
Expand description
Stores all archetypes.
Implementations
sourceimpl ArchetypeRegistry
impl ArchetypeRegistry
pub fn find_archetype(
&self,
archetype_descriptor: &ArchetypeDescriptor
) -> Option<&Archetype>
pub fn find_archetype_mut(
&mut self,
archetype_descriptor: &ArchetypeDescriptor
) -> Option<&mut Archetype>
sourcepub fn find_or_create_archetype_adding_component(
&mut self,
source_archetype_index: u16,
component_descriptor: &ComponentDescriptor
) -> Option<(&mut Archetype, u16, &mut Archetype)>
pub fn find_or_create_archetype_adding_component(
&mut self,
source_archetype_index: u16,
component_descriptor: &ComponentDescriptor
) -> Option<(&mut Archetype, u16, &mut Archetype)>
Returns mutable reference to source archetype and finds or creates a new archetype by adding the given component type as defined by component descriptor.
sourcepub fn find_or_create_archetype_removing_component(
&mut self,
source_archetype_index: u16,
component_descriptor: &ComponentDescriptor
) -> Option<(&mut Archetype, u16, &mut Archetype)>
pub fn find_or_create_archetype_removing_component(
&mut self,
source_archetype_index: u16,
component_descriptor: &ComponentDescriptor
) -> Option<(&mut Archetype, u16, &mut Archetype)>
Returns mutable reference to source archetype and finds or creates a new archetype by removing the given component type as defined by component descriptor.
pub fn find_or_create_archetype(
&mut self,
archetype_descriptor: &ArchetypeDescriptor
) -> Option<(u16, &mut Archetype)>
sourcepub unsafe fn get_unchecked(&self, index: u16) -> &Archetype
pub unsafe fn get_unchecked(&self, index: u16) -> &Archetype
sourcepub unsafe fn get_unchecked_mut(&mut self, index: u16) -> &mut Archetype
pub unsafe fn get_unchecked_mut(&mut self, index: u16) -> &mut Archetype
pub fn iter_components_matching<'a, G: ComponentGroup>(
&'a self
) -> impl Iterator<Item = <G as ComponentGroup>::SliceRefTuple<'a>>
pub fn iter_components_matching_mut<'a, G: ComponentGroup>(
&'a mut self
) -> impl Iterator<Item = <G as ComponentGroup>::SliceMutRefTuple<'a>>
pub fn iter_entity_components_matching<'a, G: ComponentGroup>(
&'a self
) -> impl Iterator<Item = (&'a [Entity], <G as ComponentGroup>::SliceRefTuple<'a>)>
pub fn iter_entity_components_matching_mut<'a, G: ComponentGroup>(
&'a mut self
) -> impl Iterator<Item = (&'a [Entity], <G as ComponentGroup>::SliceMutRefTuple<'a>)>
pub fn iter_filtered_components_matching<'a, G: ComponentGroup, F: Fn(&ArchetypeDescriptor) -> bool>(
&'a self,
filter_closure: F
) -> impl Iterator<Item = <G as ComponentGroup>::SliceRefTuple<'a>>
pub fn iter_filtered_components_matching_mut<'a, G: ComponentGroup, F: Fn(&ArchetypeDescriptor) -> bool>(
&'a mut self,
filter_closure: F
) -> impl Iterator<Item = <G as ComponentGroup>::SliceMutRefTuple<'a>>
pub fn iter_filtered_entity_components_matching<'a, G: ComponentGroup, F: Fn(&ArchetypeDescriptor) -> bool>(
&'a self,
filter_closure: F
) -> impl Iterator<Item = (&'a [Entity], <G as ComponentGroup>::SliceRefTuple<'a>)>
pub fn iter_filtered_entity_components_matching_mut<'a, G: ComponentGroup, F: Fn(&ArchetypeDescriptor) -> bool>(
&'a mut self,
filter_closure: F
) -> impl Iterator<Item = (&'a [Entity], <G as ComponentGroup>::SliceMutRefTuple<'a>)>
Trait Implementations
sourceimpl Debug for ArchetypeRegistry
impl Debug for ArchetypeRegistry
sourceimpl Default for ArchetypeRegistry
impl Default for ArchetypeRegistry
sourceimpl Index<u16> for ArchetypeRegistry
impl Index<u16> for ArchetypeRegistry
Auto Trait Implementations
impl RefUnwindSafe for ArchetypeRegistry
impl Send for ArchetypeRegistry
impl Sync for ArchetypeRegistry
impl Unpin for ArchetypeRegistry
impl UnwindSafe for ArchetypeRegistry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more