pub fn remove_from_chunk(&mut self, chunk: ChunkPosition, entity: Entity) {
        let (dirty, vec) = match self.0.get_mut(&chunk) {
            Some(vec) => vec,
            _ => return,
        };

        let (index, _) = match vec.iter().enumerate().find(|x| *x.1 == entity) {
            Some(index) => index,
            None => return,
        };
        vec.swap_remove(index);

        dirty.store(true, Ordering::SeqCst);

        if vec.is_empty() {
            self.0.remove(&chunk);
        }
    }
/// Removes an entity from a chunk.
///
/// # Panics
/// May panic in some cases if the entity is not contained
/// within the given chunk.
Removes an entity from a chunk.
Removes an entity from a chunk .
pub fn remove_from_chunk(&mut self, chunk: ChunkPosition, entity: Entity) {
        let (dirty, vec) = match self.0.get_mut(&chunk) {
            Some(vec) => vec,
            _ => return,
        };
        let (index, _) = match vec.iter().enumerate().find(|x| *x.1 == entity) {
            Some(index) => index,
            None => return,
        };
        vec.swap_remove(index);
        dirty.store(true, Ordering::SeqCst);
        if vec.is_empty() {
            self.0.remove(&chunk);
        }
    }
pub fn remove_from_chunk ( & mut self , chunk : ChunkPosition , entity : Entity ) { let ( dirty , vec ) = match self . 0 . get_mut ( & chunk ) { Some ( vec ) => vec , _ => return , } ; let ( index , _ ) = match vec . iter ( ) . enumerate ( ) . find ( | x | * x . 1 == entity ) { Some ( index ) => index , None => return , } ; vec . swap_remove ( index ) ; dirty . store ( true , Ordering :: SeqCst ) ; if vec . is_empty ( ) { self . 0 . remove ( & chunk ) ; } }
Removes an entity from a chunk.
Removes an entity from a chunk .
&mut self
chunk
ChunkPosition
entity
Entity
&mut self
chunk
ChunkPosition
entity
Entity
panics
May panic in some cases if the entity is not contained
within the given chunk.
May panic in some cases if the entity is not contained within the given chunk .