pub struct GameWorld { /* private fields */ }Expand description
High-performance generational ECS arena managing game entities with O(1) spawn, despawn, and cache-friendly iteration.
Implementations§
Source§impl GameWorld
Entity spawning, recycling, querying, and lifetime ticking for GameWorld.
impl GameWorld
Entity spawning, recycling, querying, and lifetime ticking for GameWorld.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn get_entity(&self, id: EntityId) -> Option<&EntityRecord>
pub fn get_entity(&self, id: EntityId) -> Option<&EntityRecord>
Sourcepub fn get_entity_mut(&mut self, id: EntityId) -> Option<&mut EntityRecord>
pub fn get_entity_mut(&mut self, id: EntityId) -> Option<&mut EntityRecord>
Sourcepub fn tick_lifetimes(&mut self, dt_secs: f32) -> usize
pub fn tick_lifetimes(&mut self, dt_secs: f32) -> usize
Source§impl GameWorld
impl GameWorld
pub fn get_entities(&self) -> &Vec<EntityRecord>
pub fn get_mut_entities(&mut self) -> &mut Vec<EntityRecord>
pub fn set_entities(&mut self, val: Vec<EntityRecord>) -> &mut Self
pub fn get_live_count(&self) -> usize
pub fn get_mut_live_count(&mut self) -> &mut usize
pub fn set_live_count(&mut self, val: usize) -> &mut Self
pub fn get_tick(&self) -> u64
pub fn get_mut_tick(&mut self) -> &mut u64
pub fn set_tick(&mut self, val: u64) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Forget for GameWorld
impl Freeze for GameWorld
impl Move for GameWorld
impl RefUnwindSafe for GameWorld
impl Send for GameWorldwhere
RawVecInner: Send,
impl Sync for GameWorldwhere
RawVecInner: Sync,
impl Unpin for GameWorld
impl UnsafeUnpin for GameWorldwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<EntityRecord>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
impl UnwindSafe for GameWorldwhere
RawVecInner: UnwindSafe,
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