pub struct StructureRegistry {
structures_by_id: Vec<StructureRef>,
structures_by_key: FxHashMap<Identifier, usize>,
tags: FxHashMap<Identifier, Vec<Identifier>>,
allows_registering: bool,
}Expand description
Registry of worldgen structure definitions.
Fields§
§structures_by_id: Vec<StructureRef>§structures_by_key: FxHashMap<Identifier, usize>§allows_registering: boolImplementations§
Trait Implementations§
Source§impl Default for StructureRegistry
impl Default for StructureRegistry
Source§impl RegistryExt for StructureRegistry
impl RegistryExt for StructureRegistry
type Entry = StructureData
fn freeze(&mut self)
fn by_id(&self, id: usize) -> Option<&'static StructureData>
fn by_key(&self, key: &Identifier) -> Option<&'static StructureData>
fn id_from_key(&self, key: &Identifier) -> Option<usize>
fn len(&self) -> usize
fn is_empty(&self) -> bool
Source§impl TaggedRegistryExt for StructureRegistry
impl TaggedRegistryExt for StructureRegistry
fn register_tag(&mut self, tag: Identifier, keys: &[&'static str])
fn modify_tag( &mut self, tag: &Identifier, f: impl FnOnce(Vec<Identifier>) -> Vec<Identifier>, )
fn is_in_tag(&self, entry: &Self::Entry, tag: &Identifier) -> bool
fn get_tag(&self, tag: &Identifier) -> Option<Vec<&'static Self::Entry>>
fn iter_tag( &self, tag: &Identifier, ) -> impl Iterator<Item = &'static Self::Entry> + '_
fn tag_keys(&self) -> impl Iterator<Item = &Identifier> + '_
Auto Trait Implementations§
impl Freeze for StructureRegistry
impl RefUnwindSafe for StructureRegistry
impl Send for StructureRegistry
impl Sync for StructureRegistry
impl Unpin for StructureRegistry
impl UnsafeUnpin for StructureRegistry
impl UnwindSafe for StructureRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more