pub struct GameWorld { /* private fields */ }Expand description
High-performance generational ECS arena managing game entities with O(1) spawn, despawn, and Structure-of-Arrays hot streams.
Implementations§
Source§impl GameWorld
Entity spawning, recycling, Structure-of-Arrays synchronization, querying, and lifetime ticking for GameWorld.
impl GameWorld
Entity spawning, recycling, Structure-of-Arrays synchronization, querying, and lifetime ticking for GameWorld.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn sync_soa_from_entities(&mut self)
pub fn sync_soa_from_entities(&mut self)
Synchronizes the dense SoA transforms, velocities, and cold_meta arrays from entities.
§Arguments
&Self- Mutable game world.
Sourcepub fn sync_entities_from_soa(&mut self)
pub fn sync_entities_from_soa(&mut self)
Writes updated SoA transforms and velocities back into the entities mirror.
§Arguments
&Self- Mutable game world.
Sourcepub fn teleport_entity(&mut self, id: EntityId, position: Point) -> bool
pub fn teleport_entity(&mut self, id: EntityId, position: Point) -> bool
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_transforms(&self) -> &Vec<EntityTransform>
pub fn get_mut_transforms(&mut self) -> &mut Vec<EntityTransform>
pub fn set_transforms(&mut self, val: Vec<EntityTransform>) -> &mut Self
pub fn get_velocities(&self) -> &Vec<Velocity2D>
pub fn get_mut_velocities(&mut self) -> &mut Vec<Velocity2D>
pub fn set_velocities(&mut self, val: Vec<Velocity2D>) -> &mut Self
pub fn get_cold_meta(&self) -> &Vec<EntityColdMeta>
pub fn get_mut_cold_meta(&mut self) -> &mut Vec<EntityColdMeta>
pub fn set_cold_meta(&mut self, val: Vec<EntityColdMeta>) -> &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 GameWorldwhere
*const u8 is !null: Freeze,
PhantomData<EntityRecord>: Freeze,
PhantomData<EntityTransform>: Freeze,
PhantomData<Velocity2D>: Freeze,
PhantomData<EntityColdMeta>: Freeze,
PhantomData<u32>: Freeze,
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<EntityTransform>: UnsafeUnpin,
PhantomData<Velocity2D>: UnsafeUnpin,
PhantomData<EntityColdMeta>: 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