Rename EntityId to EntityIndex (#6732)

Continuation of #6107

Co-authored-by: devil-ira <justthecooldude@gmail.com>
This commit is contained in:
ira 2022-11-22 20:38:35 +00:00
parent c069c544a7
commit a1607b8065

View File

@ -6,7 +6,7 @@ use crate::{
use bevy_ptr::{OwningPtr, Ptr}; use bevy_ptr::{OwningPtr, Ptr};
use std::{cell::UnsafeCell, hash::Hash, marker::PhantomData}; use std::{cell::UnsafeCell, hash::Hash, marker::PhantomData};
type EntityId = u32; type EntityIndex = u32;
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct SparseArray<I, V = I> { pub(crate) struct SparseArray<I, V = I> {
@ -102,14 +102,14 @@ impl<I: SparseSetIndex, V> SparseArray<I, V> {
#[derive(Debug)] #[derive(Debug)]
pub struct ComponentSparseSet { pub struct ComponentSparseSet {
dense: Column, dense: Column,
// Internally this only relies on the Entity ID to keep track of where the component data is // Internally this only relies on the Entity index to keep track of where the component data is
// stored for entities that are alive. The generation is not required, but is stored // stored for entities that are alive. The generation is not required, but is stored
// in debug builds to validate that access is correct. // in debug builds to validate that access is correct.
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
entities: Vec<EntityId>, entities: Vec<EntityIndex>,
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
entities: Vec<Entity>, entities: Vec<Entity>,
sparse: SparseArray<EntityId, u32>, sparse: SparseArray<EntityIndex, u32>,
} }
impl ComponentSparseSet { impl ComponentSparseSet {