pub(crate) unsafe fn ungroup_components(
    storages: &mut [AtomicRefCell<ComponentStorage>],
    group_len: &mut usize,
    entity: Entity,
) {
    if *group_len > 0 {
        let swap_index = *group_len - 1;

        for storage in storages.iter_mut().map(|storage| storage.get_mut()) {
            let index = storage.get_index_entity(entity).unsafe_unwrap().dense();
            storage.swap_unchecked(index, swap_index);
        }

        *group_len -= 1;
    }
}
/// Must only be called with grouped components.
Must only be called with grouped components.
Must only be called with grouped components .
pub(crate) unsafe fn ungroup_components(
    storages: &mut [AtomicRefCell<ComponentStorage>],
    group_len: &mut usize,
    entity: Entity,
) {
    if *group_len > 0 {
        let swap_index = *group_len - 1;
        for storage in storages.iter_mut().map(|storage| storage.get_mut()) {
            let index = storage.get_index_entity(entity).unsafe_unwrap().dense();
            storage.swap_unchecked(index, swap_index);
        }
        *group_len -= 1;
    }
}
pub ( crate ) unsafe fn ungroup_components ( storages : & mut [ AtomicRefCell < ComponentStorage > ] , group_len : & mut usize , entity : Entity , ) { if * group_len > 0 { let swap_index = * group_len - 1 ; for storage in storages . iter_mut ( ) . map ( | storage | storage . get_mut ( ) ) { let index = storage . get_index_entity ( entity ) . unsafe_unwrap ( ) . dense ( ) ; storage . swap_unchecked ( index , swap_index ) ; } * group_len -= 1 ; } }
Must only be called with grouped components.
Must only be called with grouped components .
storages
&mut [AtomicRefCell<ComponentStorage>]
group_len
&mut usize
entity
Entity
storages
&mut [AtomicRefCell<ComponentStorage>]
group_len
&mut usize
entity
Entity