pub struct World {Show 19 fields
pub random: ChaCha20Rng,
pub data: Box<dyn Cave>,
pub definitions_in_source: HashMap<String, Vec<(String, ComponentType)>>,
pub component_names: Vec<String>,
pub component_types: HashMap<String, ComponentType>,
pub registered_states: HashMap<String, ComponentSignature>,
pub registered_events: HashMap<String, ComponentSignature>,
pub registered_tags: HashSet<String>,
pub storage_pointers: HashMap<String, BinaryComponent>,
pub entity_bitmap: Bitmap<MAX_ENTRIES_PER_STORAGE>,
pub event_queues: HashMap<String, VecDeque<BinaryComponent>>,
pub next_event_queues: HashMap<String, VecDeque<BinaryComponent>>,
pub storage_bitmaps: HashMap<String, Bitmap<MAX_ENTRIES_PER_STORAGE>>,
pub system_priorities: HashMap<SystemPriority, u16>,
pub unique_storage: HashMap<u32, RascalValue>,
pub field_storage: HashMap<FieldId, Field>,
pub set_storage: HashMap<SetId, HashSet<(i32, i32)>>,
pub set_cache: HashMap<Geom, HashSet<(i32, i32)>>,
pub size: (u32, u32),
}
Fields
random: ChaCha20Rng
data: Box<dyn Cave>
definitions_in_source: HashMap<String, Vec<(String, ComponentType)>>
component_names: Vec<String>
component_types: HashMap<String, ComponentType>
registered_states: HashMap<String, ComponentSignature>
registered_events: HashMap<String, ComponentSignature>
storage_pointers: HashMap<String, BinaryComponent>
entity_bitmap: Bitmap<MAX_ENTRIES_PER_STORAGE>
event_queues: HashMap<String, VecDeque<BinaryComponent>>
next_event_queues: HashMap<String, VecDeque<BinaryComponent>>
storage_bitmaps: HashMap<String, Bitmap<MAX_ENTRIES_PER_STORAGE>>
system_priorities: HashMap<SystemPriority, u16>
unique_storage: HashMap<u32, RascalValue>
field_storage: HashMap<FieldId, Field>
set_storage: HashMap<SetId, HashSet<(i32, i32)>>
set_cache: HashMap<Geom, HashSet<(i32, i32)>>
size: (u32, u32)
Implementations
sourceimpl World
impl World
pub fn clear_entities(&mut self)
pub fn contains_event(&self, event_name: &str) -> bool
pub fn add_tag(&mut self, entity: usize, comp_type: &str)
pub fn run_all_systems(&mut self)
pub fn create_entity(&mut self) -> usize
pub fn register_system(&mut self, s: RascalStruct)
pub fn register_component(&mut self, v: RascalStruct)
Trait Implementations
sourceimpl AddComponent<RascalValue> for World
impl AddComponent<RascalValue> for World
fn add_component(
&mut self,
entity: usize,
comp_type: &str,
comp_value: Vec<RascalValue>
)
sourceimpl AddComponent<u8> for World
impl AddComponent<u8> for World
sourceimpl TriggerEvent<RascalValue> for World
impl TriggerEvent<RascalValue> for World
fn trigger_event(&mut self, comp_type: &str, comp_value: Vec<RascalValue>)
sourceimpl TriggerEvent<u8> for World
impl TriggerEvent<u8> for World
fn trigger_event(&mut self, comp_type: &str, comp_value: Vec<u8>)
Auto Trait Implementations
impl !RefUnwindSafe for World
impl Send for World
impl Sync for World
impl Unpin for World
impl !UnwindSafe for World
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.