From 8a7c553f42941658219742b508ca77859dc082af Mon Sep 17 00:00:00 2001 From: rosefarts Date: Sun, 15 Sep 2024 13:16:54 +0200 Subject: [PATCH 1/4] explicitly mention `component` in methods --- crates/bevy_scene/src/dynamic_scene_builder.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/bevy_scene/src/dynamic_scene_builder.rs b/crates/bevy_scene/src/dynamic_scene_builder.rs index 26084c1a3e27f..e5ee0dec09839 100644 --- a/crates/bevy_scene/src/dynamic_scene_builder.rs +++ b/crates/bevy_scene/src/dynamic_scene_builder.rs @@ -76,7 +76,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// Specify a custom component [`SceneFilter`] to be used with this builder. #[must_use] - pub fn with_filter(mut self, filter: SceneFilter) -> Self { + pub fn with_component_filter(mut self, filter: SceneFilter) -> Self { self.component_filter = filter; self } @@ -95,7 +95,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// This is the inverse of [`deny`](Self::deny). /// If `T` has already been denied, then it will be removed from the denylist. #[must_use] - pub fn allow(mut self) -> Self { + pub fn allow_component(mut self) -> Self { self.component_filter = self.component_filter.allow::(); self } @@ -107,7 +107,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// This is the inverse of [`allow`](Self::allow). /// If `T` has already been allowed, then it will be removed from the allowlist. #[must_use] - pub fn deny(mut self) -> Self { + pub fn deny_component(mut self) -> Self { self.component_filter = self.component_filter.deny::(); self } @@ -118,7 +118,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// [denied]: Self::deny #[must_use] - pub fn allow_all(mut self) -> Self { + pub fn allow_all_components(mut self) -> Self { self.component_filter = SceneFilter::allow_all(); self } @@ -129,7 +129,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// [allowed]: Self::allow #[must_use] - pub fn deny_all(mut self) -> Self { + pub fn deny_all_components(mut self) -> Self { self.component_filter = SceneFilter::deny_all(); self } @@ -571,7 +571,7 @@ mod tests { let entity_b = world.spawn(ComponentB).id(); let scene = DynamicSceneBuilder::from_world(&world) - .allow::() + .allow_component::() .extract_entities([entity_a_b, entity_a, entity_b].into_iter()) .build(); @@ -598,7 +598,7 @@ mod tests { let entity_b = world.spawn(ComponentB).id(); let scene = DynamicSceneBuilder::from_world(&world) - .deny::() + .deny_component::() .extract_entities([entity_a_b, entity_a, entity_b].into_iter()) .build(); From 11c507ccaa785272004b5538ad27454ff97957d0 Mon Sep 17 00:00:00 2001 From: rosefarts Date: Sun, 15 Sep 2024 14:01:24 +0200 Subject: [PATCH 2/4] fix docs --- crates/bevy_scene/src/dynamic_scene_builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_scene/src/dynamic_scene_builder.rs b/crates/bevy_scene/src/dynamic_scene_builder.rs index e5ee0dec09839..6ffd2e19a2733 100644 --- a/crates/bevy_scene/src/dynamic_scene_builder.rs +++ b/crates/bevy_scene/src/dynamic_scene_builder.rs @@ -92,7 +92,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This method may be called multiple times for any number of components. /// - /// This is the inverse of [`deny`](Self::deny). + /// This is the inverse of [`deny`](Self::deny_component). /// If `T` has already been denied, then it will be removed from the denylist. #[must_use] pub fn allow_component(mut self) -> Self { @@ -104,7 +104,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This method may be called multiple times for any number of components. /// - /// This is the inverse of [`allow`](Self::allow). + /// This is the inverse of [`allow`](Self::allow_component). /// If `T` has already been allowed, then it will be removed from the allowlist. #[must_use] pub fn deny_component(mut self) -> Self { @@ -116,7 +116,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This is useful for resetting the filter so that types may be selectively [denied]. /// - /// [denied]: Self::deny + /// [denied]: Self::deny_component #[must_use] pub fn allow_all_components(mut self) -> Self { self.component_filter = SceneFilter::allow_all(); @@ -127,7 +127,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This is useful for resetting the filter so that types may be selectively [allowed]. /// - /// [allowed]: Self::allow + /// [allowed]: Self::allow_component #[must_use] pub fn deny_all_components(mut self) -> Self { self.component_filter = SceneFilter::deny_all(); From 01d55c2852083f8afc2edab678e038dc15cfbbaa Mon Sep 17 00:00:00 2001 From: rosefarts Date: Sun, 15 Sep 2024 14:09:28 +0200 Subject: [PATCH 3/4] fix docs again --- crates/bevy_scene/src/dynamic_scene_builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_scene/src/dynamic_scene_builder.rs b/crates/bevy_scene/src/dynamic_scene_builder.rs index 6ffd2e19a2733..42228620e59ed 100644 --- a/crates/bevy_scene/src/dynamic_scene_builder.rs +++ b/crates/bevy_scene/src/dynamic_scene_builder.rs @@ -92,7 +92,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This method may be called multiple times for any number of components. /// - /// This is the inverse of [`deny`](Self::deny_component). + /// This is the inverse of [`deny_component`](Self::deny_component). /// If `T` has already been denied, then it will be removed from the denylist. #[must_use] pub fn allow_component(mut self) -> Self { @@ -104,7 +104,7 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// This method may be called multiple times for any number of components. /// - /// This is the inverse of [`allow`](Self::allow_component). + /// This is the inverse of [`allow_component`](Self::allow_component). /// If `T` has already been allowed, then it will be removed from the allowlist. #[must_use] pub fn deny_component(mut self) -> Self { From fa250f71c04b7c0621049055f88dc28b96a04d46 Mon Sep 17 00:00:00 2001 From: rosefarts Date: Sun, 15 Sep 2024 16:18:10 +0200 Subject: [PATCH 4/4] fix focs forever --- crates/bevy_scene/src/dynamic_scene_builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_scene/src/dynamic_scene_builder.rs b/crates/bevy_scene/src/dynamic_scene_builder.rs index 42228620e59ed..f254b2099fc85 100644 --- a/crates/bevy_scene/src/dynamic_scene_builder.rs +++ b/crates/bevy_scene/src/dynamic_scene_builder.rs @@ -16,8 +16,8 @@ use std::collections::BTreeMap; /// /// By default, all components registered with [`ReflectComponent`] type data in a world's [`AppTypeRegistry`] will be extracted. /// (this type data is added automatically during registration if [`Reflect`] is derived with the `#[reflect(Component)]` attribute). -/// This can be changed by [specifying a filter](DynamicSceneBuilder::with_filter) or by explicitly -/// [allowing](DynamicSceneBuilder::allow)/[denying](DynamicSceneBuilder::deny) certain components. +/// This can be changed by [specifying a filter](DynamicSceneBuilder::with_component_filter) or by explicitly +/// [allowing](DynamicSceneBuilder::allow_component)/[denying](DynamicSceneBuilder::deny_component) certain components. /// /// Extraction happens immediately and uses the filter as it exists during the time of extraction. /// @@ -242,8 +242,8 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// Note that components extracted from queried entities must still pass through the filter if one is set. /// - /// [`allow`]: Self::allow - /// [`deny`]: Self::deny + /// [`allow`]: Self::allow_component + /// [`deny`]: Self::deny_component #[must_use] pub fn extract_entities(mut self, entities: impl Iterator) -> Self { let type_registry = self.original_world.resource::().read();