Rename ArchetypeEntity::entity into ArchetypeEntity::id (#11118)

# Objective

Fixes #11050

Rename ArchetypeEntity::entity to ArchetypeEntity::id to be consistent
with `EntityWorldMut`, `EntityMut` and `EntityRef`.

## Migration Guide

The method `ArchetypeEntity::entity` has been renamed to
`ArchetypeEntity::id`
This commit is contained in:
capt-glorypants 2024-01-01 17:12:24 +01:00 committed by GitHub
parent bf0be9cc2c
commit ffded5b78e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -272,7 +272,7 @@ pub struct ArchetypeEntity {
impl ArchetypeEntity { impl ArchetypeEntity {
/// The ID of the entity. /// The ID of the entity.
#[inline] #[inline]
pub const fn entity(&self) -> Entity { pub const fn id(&self) -> Entity {
self.entity self.entity
} }

View File

@ -178,7 +178,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
// Caller assures `index` in range of the current archetype. // Caller assures `index` in range of the current archetype.
if !F::filter_fetch( if !F::filter_fetch(
&mut self.cursor.filter, &mut self.cursor.filter,
archetype_entity.entity(), archetype_entity.id(),
archetype_entity.table_row(), archetype_entity.table_row(),
) { ) {
continue; continue;
@ -188,7 +188,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
// Caller assures `index` in range of the current archetype. // Caller assures `index` in range of the current archetype.
let item = D::fetch( let item = D::fetch(
&mut self.cursor.fetch, &mut self.cursor.fetch,
archetype_entity.entity(), archetype_entity.id(),
archetype_entity.table_row(), archetype_entity.table_row(),
); );
@ -719,7 +719,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIterationCursor<'w, 's, D, F> {
let archetype_entity = self.archetype_entities.get_unchecked(index); let archetype_entity = self.archetype_entities.get_unchecked(index);
Some(D::fetch( Some(D::fetch(
&mut self.fetch, &mut self.fetch,
archetype_entity.entity(), archetype_entity.id(),
archetype_entity.table_row(), archetype_entity.table_row(),
)) ))
} }
@ -817,7 +817,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIterationCursor<'w, 's, D, F> {
let archetype_entity = self.archetype_entities.get_unchecked(self.current_row); let archetype_entity = self.archetype_entities.get_unchecked(self.current_row);
if !F::filter_fetch( if !F::filter_fetch(
&mut self.filter, &mut self.filter,
archetype_entity.entity(), archetype_entity.id(),
archetype_entity.table_row(), archetype_entity.table_row(),
) { ) {
self.current_row += 1; self.current_row += 1;
@ -831,7 +831,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIterationCursor<'w, 's, D, F> {
// - fetch is only called once for each `archetype_entity`. // - fetch is only called once for each `archetype_entity`.
let item = D::fetch( let item = D::fetch(
&mut self.fetch, &mut self.fetch,
archetype_entity.entity(), archetype_entity.id(),
archetype_entity.table_row(), archetype_entity.table_row(),
); );
self.current_row += 1; self.current_row += 1;

View File

@ -507,7 +507,7 @@ impl World {
.iter() .iter()
.enumerate() .enumerate()
.map(|(archetype_row, archetype_entity)| { .map(|(archetype_row, archetype_entity)| {
let entity = archetype_entity.entity(); let entity = archetype_entity.id();
let location = EntityLocation { let location = EntityLocation {
archetype_id: archetype.id(), archetype_id: archetype.id(),
archetype_row: ArchetypeRow::new(archetype_row), archetype_row: ArchetypeRow::new(archetype_row),
@ -536,7 +536,7 @@ impl World {
.iter() .iter()
.enumerate() .enumerate()
.map(move |(archetype_row, archetype_entity)| { .map(move |(archetype_row, archetype_entity)| {
let entity = archetype_entity.entity(); let entity = archetype_entity.id();
let location = EntityLocation { let location = EntityLocation {
archetype_id: archetype.id(), archetype_id: archetype.id(),
archetype_row: ArchetypeRow::new(archetype_row), archetype_row: ArchetypeRow::new(archetype_row),

View File

@ -96,7 +96,7 @@ impl Scene {
for scene_entity in archetype.entities() { for scene_entity in archetype.entities() {
let entity = *instance_info let entity = *instance_info
.entity_map .entity_map
.entry(scene_entity.entity()) .entry(scene_entity.id())
.or_insert_with(|| world.spawn_empty().id()); .or_insert_with(|| world.spawn_empty().id());
for component_id in archetype.components() { for component_id in archetype.components() {
let component_info = self let component_info = self
@ -117,7 +117,7 @@ impl Scene {
} }
}) })
})?; })?;
reflect_component.copy(&self.world, world, scene_entity.entity(), entity); reflect_component.copy(&self.world, world, scene_entity.id(), entity);
} }
} }
} }