-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy
Description
What problem does this solve or what need does it fill?
If a function exists that takes an EntityRef, it would be nice to be able to call this function using an EntityMut.
Currently, this is not possible and you have to do a second lookup to get the EntityRef you need.
What solution would you like?
Add a function, like the following, onto EntityMut:
pub fn to_ref(self) -> EntityRef {
EntityRef {
world: self.world,
entity: self.entity,
location: self.location
}
}Could be implemented like this, or by leveraging From
What alternative(s) have you considered?
Shared super-trait for EntityRef and EntityMut, though this is more complicated and would force use of generics unnecessarily
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy