Skip to content

Split WorldQuery into WorldQueryData and WorldQueryFilter #9918

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

Merged
merged 14 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
12 changes: 6 additions & 6 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,16 +453,16 @@ fn entity_from_path(
/// Verify that there are no ancestors of a given entity that have an [`AnimationPlayer`].
fn verify_no_ancestor_player(
player_parent: Option<&Parent>,
parents: &Query<(Option<With<AnimationPlayer>>, Option<&Parent>)>,
parents: &Query<(Has<AnimationPlayer>, Option<&Parent>)>,
) -> bool {
let Some(mut current) = player_parent.map(Parent::get) else {
return true;
};
loop {
let Ok((maybe_player, parent)) = parents.get(current) else {
let Ok((has_animation_player, parent)) = parents.get(current) else {
return true;
};
if maybe_player.is_some() {
if has_animation_player {
return false;
}
if let Some(parent) = parent {
Expand All @@ -483,7 +483,7 @@ pub fn animation_player(
names: Query<&Name>,
transforms: Query<&mut Transform>,
morphs: Query<&mut MorphWeights>,
parents: Query<(Option<With<AnimationPlayer>>, Option<&Parent>)>,
parents: Query<(Has<AnimationPlayer>, Option<&Parent>)>,
mut animation_players: Query<(Entity, Option<&Parent>, &mut AnimationPlayer)>,
) {
animation_players
Expand Down Expand Up @@ -515,7 +515,7 @@ fn run_animation_player(
transforms: &Query<&mut Transform>,
morphs: &Query<&mut MorphWeights>,
maybe_parent: Option<&Parent>,
parents: &Query<(Option<With<AnimationPlayer>>, Option<&Parent>)>,
parents: &Query<(Has<AnimationPlayer>, Option<&Parent>)>,
children: &Query<&Children>,
) {
let paused = player.paused;
Expand Down Expand Up @@ -599,7 +599,7 @@ fn apply_animation(
transforms: &Query<&mut Transform>,
morphs: &Query<&mut MorphWeights>,
maybe_parent: Option<&Parent>,
parents: &Query<(Option<With<AnimationPlayer>>, Option<&Parent>)>,
parents: &Query<(Has<AnimationPlayer>, Option<&Parent>)>,
children: &Query<&Children>,
) {
if let Some(animation_clip) = animations.get(&animation.animation_clip) {
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_core/src/name.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy_ecs::{
component::Component, entity::Entity, query::WorldQuery, reflect::ReflectComponent,
};
use bevy_ecs::query::WorldQueryData;
use bevy_ecs::{component::Component, entity::Entity, reflect::ReflectComponent};

use bevy_reflect::std_traits::ReflectDefault;
use bevy_reflect::Reflect;
use bevy_utils::AHasher;
Expand Down Expand Up @@ -102,7 +102,7 @@ impl std::fmt::Debug for Name {
/// }
/// # bevy_ecs::system::assert_is_system(increment_score);
/// ```
#[derive(WorldQuery)]
#[derive(WorldQueryData)]
pub struct DebugName {
/// A [`Name`] that the entity might have that is displayed if available.
pub name: Option<&'static Name>,
Expand Down
Loading