mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
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:
parent
bf0be9cc2c
commit
ffded5b78e
4 changed files with 10 additions and 10 deletions
|
@ -272,7 +272,7 @@ pub struct ArchetypeEntity {
|
|||
impl ArchetypeEntity {
|
||||
/// The ID of the entity.
|
||||
#[inline]
|
||||
pub const fn entity(&self) -> Entity {
|
||||
pub const fn id(&self) -> Entity {
|
||||
self.entity
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
if !F::filter_fetch(
|
||||
&mut self.cursor.filter,
|
||||
archetype_entity.entity(),
|
||||
archetype_entity.id(),
|
||||
archetype_entity.table_row(),
|
||||
) {
|
||||
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.
|
||||
let item = D::fetch(
|
||||
&mut self.cursor.fetch,
|
||||
archetype_entity.entity(),
|
||||
archetype_entity.id(),
|
||||
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);
|
||||
Some(D::fetch(
|
||||
&mut self.fetch,
|
||||
archetype_entity.entity(),
|
||||
archetype_entity.id(),
|
||||
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);
|
||||
if !F::filter_fetch(
|
||||
&mut self.filter,
|
||||
archetype_entity.entity(),
|
||||
archetype_entity.id(),
|
||||
archetype_entity.table_row(),
|
||||
) {
|
||||
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`.
|
||||
let item = D::fetch(
|
||||
&mut self.fetch,
|
||||
archetype_entity.entity(),
|
||||
archetype_entity.id(),
|
||||
archetype_entity.table_row(),
|
||||
);
|
||||
self.current_row += 1;
|
||||
|
|
|
@ -507,7 +507,7 @@ impl World {
|
|||
.iter()
|
||||
.enumerate()
|
||||
.map(|(archetype_row, archetype_entity)| {
|
||||
let entity = archetype_entity.entity();
|
||||
let entity = archetype_entity.id();
|
||||
let location = EntityLocation {
|
||||
archetype_id: archetype.id(),
|
||||
archetype_row: ArchetypeRow::new(archetype_row),
|
||||
|
@ -536,7 +536,7 @@ impl World {
|
|||
.iter()
|
||||
.enumerate()
|
||||
.map(move |(archetype_row, archetype_entity)| {
|
||||
let entity = archetype_entity.entity();
|
||||
let entity = archetype_entity.id();
|
||||
let location = EntityLocation {
|
||||
archetype_id: archetype.id(),
|
||||
archetype_row: ArchetypeRow::new(archetype_row),
|
||||
|
|
|
@ -96,7 +96,7 @@ impl Scene {
|
|||
for scene_entity in archetype.entities() {
|
||||
let entity = *instance_info
|
||||
.entity_map
|
||||
.entry(scene_entity.entity())
|
||||
.entry(scene_entity.id())
|
||||
.or_insert_with(|| world.spawn_empty().id());
|
||||
for component_id in archetype.components() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue