-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Rename bevy_ecs::world::Entry to ComponentEntry #19517
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
base: main
Are you sure you want to change the base?
Conversation
Ping @urben1680 for review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few docs that need to be updated.
I cannot mark everything because it is not close enough to the changes, so here is a list of what I saw in entity_ref.rs
:
- line 2578, just rename "Entry" to "entry", no need to name the whole type when other docs also just call it "entry"
- line 3025 a comment should be adjusted from "OccupiedEntry" to "OccupiedComponentEntry"
- line 3081 has `Entry` so that might want to be the correct full type.
- line 3331 `OccupiedEntry` -> `OccupiedComponentEntry`
} | ||
} | ||
} | ||
|
||
impl<'w, 'a, T: Component> Entry<'w, 'a, T> { | ||
impl<'w, 'a, T: Component> ComponentEntry<'w, 'a, T> { | ||
/// Replaces the component of the entry, and returns an [`OccupiedEntry`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Replaces the component of the entry, and returns an [`OccupiedEntry`]. | |
/// Replaces the component of the entry, and returns an [`OccupiedComponentEntry`]. |
Entry::Occupied(entry) => entry, | ||
Entry::Vacant(entry) => entry.insert(Default::default()), | ||
ComponentEntry::Occupied(entry) => entry, | ||
ComponentEntry::Vacant(entry) => entry.insert(Default::default()), | ||
} | ||
} | ||
} | ||
|
||
/// A view into an occupied entry in a [`EntityWorldMut`]. It is part of the [`Entry`] enum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A view into an occupied entry in a [`EntityWorldMut`]. It is part of the [`Entry`] enum. | |
/// A view into an occupied entry in a [`EntityWorldMut`]. It is part of the [`ComponentEntry`] enum. |
@@ -3139,12 +3139,12 @@ impl<'w, 'a, T: Component<Mutability = Mutable>> OccupiedEntry<'w, 'a, T> { | |||
} | |||
|
|||
/// A view into a vacant entry in a [`EntityWorldMut`]. It is part of the [`Entry`] enum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A view into a vacant entry in a [`EntityWorldMut`]. It is part of the [`Entry`] enum. | |
/// A view into a vacant entry in a [`EntityWorldMut`]. It is part of the [`ComponentEntry`] enum. |
entity_world: &'a mut EntityWorldMut<'w>, | ||
_marker: PhantomData<T>, | ||
} | ||
|
||
impl<'w, 'a, T: Component> VacantEntry<'w, 'a, T> { | ||
impl<'w, 'a, T: Component> VacantComponentEntry<'w, 'a, T> { | ||
/// Inserts the component into the `VacantEntry` and returns an `OccupiedEntry`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Inserts the component into the `VacantEntry` and returns an `OccupiedEntry`. | |
/// Inserts the component into the `VacantComponentEntry` and returns an `OccupiedComponentEntry`. |
Objective
As discussed in #19285, some of our names conflict.
Entry
in bevy_ecs is one of those overly general names.Solution
Rename this type (and the related types) to
ComponentEntry
.