pub struct GlobalEntities { /* private fields */ }
Expand description
The global entities palette used in level environment.
Implementations§
Source§impl GlobalEntities
impl GlobalEntities
pub fn new() -> Self
Sourcepub fn with_all(slice: &[&'static EntityType]) -> Self
pub fn with_all(slice: &[&'static EntityType]) -> Self
A simple constructor to directly call register_all
with given entity types slice.
Sourcepub fn register(&mut self, entity_type: &'static EntityType)
pub fn register(&mut self, entity_type: &'static EntityType)
Register a single entity type to this palette.
Sourcepub fn register_all(&mut self, slice: &[&'static EntityType])
pub fn register_all(&mut self, slice: &[&'static EntityType])
An optimized way to call register
multiple times for each given entity type.
Sourcepub fn get_entity_type(&self, name: &str) -> Option<&'static EntityType>
pub fn get_entity_type(&self, name: &str) -> Option<&'static EntityType>
Get an entity type from its name.
pub fn get_codecs( &self, entity_type: &'static EntityType, ) -> Option<&Vec<&'static dyn EntityCodec>>
pub fn get_entity_type_and_codecs( &self, name: &str, ) -> Option<(&'static EntityType, &Vec<&'static dyn EntityCodec>)>
pub fn has_entity_type(&self, entity_type: &'static EntityType) -> bool
pub fn entity_types_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for GlobalEntities
impl !RefUnwindSafe for GlobalEntities
impl Send for GlobalEntities
impl Sync for GlobalEntities
impl Unpin for GlobalEntities
impl !UnwindSafe for GlobalEntities
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