-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Entity{Ref,Mut}Except is duplicate functionality to FilteredEntity{Ref,Mut} #17784
Comments
I'd like to merge these back together, but we have to be careful to ensure that the existing use cases are still supported. |
I added |
Calling Access::read_all_components first inverts the behavior to a blocklist instead of an allowlist. |
The "Pointing Fingers: Deduplicating Entity APIs with EntityPtr" working group is planning to merge a lot of the code between these types, so they'll eventually be able to share implementations of methods like Note that |
I see nothing in the type that would stop a switch to |
My PR has an implementation for converting from |
…ilteredEntity{Ref,Mut} (#17800) # Objective Related to #17784. The ticket is actually about just getting rid of `Entity{Ref,Mut}Except` in favor of `FilteredEntity{Ref,Mut}`, but I got told the unification of Entity types is a bigger endeavor that has been going on for a while now (as the "Pointing Fingers" working group) and I should just add the functions I actually need in the meantime. ## Solution This PR adds all of the functions necessary to access components by TypeId or ComponentId instead of static types. ## Testing > Did you test these changes? If so, how? Haven't tested it yet, but the changes are mostly copy/paste from other implementations in the same file, since there is a lot of duplicated functionality there. ## Not a Migration Guide There shouldn't be any breaking changes, it's just a few new functions on existing types. I had to shuffle around the lifetimes in `From<&EntityMutExcept<'a, B>> for EntityRefExcept<'a, B>` (originally it was `From<&'a EntityMutExcept<'_, B>> for EntityRefExcept<'_, B>`) to make the borrow checker happy, but I don't think that this should have an impact on user code (correct me if I'm wrong).
…ilteredEntity{Ref,Mut} (bevyengine#17800) # Objective Related to bevyengine#17784. The ticket is actually about just getting rid of `Entity{Ref,Mut}Except` in favor of `FilteredEntity{Ref,Mut}`, but I got told the unification of Entity types is a bigger endeavor that has been going on for a while now (as the "Pointing Fingers" working group) and I should just add the functions I actually need in the meantime. ## Solution This PR adds all of the functions necessary to access components by TypeId or ComponentId instead of static types. ## Testing > Did you test these changes? If so, how? Haven't tested it yet, but the changes are mostly copy/paste from other implementations in the same file, since there is a lot of duplicated functionality there. ## Not a Migration Guide There shouldn't be any breaking changes, it's just a few new functions on existing types. I had to shuffle around the lifetimes in `From<&EntityMutExcept<'a, B>> for EntityRefExcept<'a, B>` (originally it was `From<&'a EntityMutExcept<'_, B>> for EntityRefExcept<'_, B>`) to make the borrow checker happy, but I don't think that this should have an impact on user code (correct me if I'm wrong).
Bevy version
0.15.2
What you did
Working on animation stuff.
What went wrong
Entity{Ref,Mut}Except
are missing some functionality I need, likeget_by_id
. However, it appears that these types aren't used anywhere except the animation system, and it should be possible to replace them with the existingFilteredEntity{Ref,Mut}
, which has all the functions I need.The text was updated successfully, but these errors were encountered: