Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/archetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_ecs/src/query/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(),
);

Expand Down Expand Up @@ -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(),
))
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_scene/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
}
Expand Down