From 56cea0fdb8db9c6af495b0c6309ca53f559df58f Mon Sep 17 00:00:00 2001 From: Ellen Date: Sun, 6 Sep 2020 20:46:47 +0100 Subject: [PATCH 1/2] Update docs for Updated, Changed and Mutated --- crates/bevy_ecs/hecs/src/query.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs index 14794c9686fd7..3c5c62d4243bc 100644 --- a/crates/bevy_ecs/hecs/src/query.rs +++ b/crates/bevy_ecs/hecs/src/query.rs @@ -323,8 +323,8 @@ pub struct Or(PhantomData); pub struct FetchOr(T); /// Query transformer that skips entities that have a `T` component that has -/// not been mutated since the last pass of the system. This does not include -/// components that were added in since the last pass. +/// not been mutated since the start of the frame. +/// Added components do not count as mutated. pub struct Mutated<'a, T> { value: &'a T, } @@ -389,7 +389,8 @@ impl<'a, T: Component> Fetch<'a> for FetchMutated { } } -#[allow(missing_docs)] +/// Query transformer that skips entities with a `T` component that has +/// not been added since the start of the frame. pub struct Added<'a, T> { value: &'a T, } @@ -452,8 +453,8 @@ impl<'a, T: Component> Fetch<'a> for FetchAdded { } } -/// Query transformer skipping entities that have not been either mutated or added -/// since the last pass of the system +/// Query transformer that skips entities that have a 'T' component that has +/// not been either mutated or added since the start of the frame. pub struct Changed<'a, T> { value: &'a T, } From 62573522723623c63cdc10d750be4a497250d12f Mon Sep 17 00:00:00 2001 From: Ellen Date: Sun, 6 Sep 2020 21:18:06 +0100 Subject: [PATCH 2/2] Less clunky wording maybe? --- crates/bevy_ecs/hecs/src/query.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/bevy_ecs/hecs/src/query.rs b/crates/bevy_ecs/hecs/src/query.rs index 3c5c62d4243bc..120e392597f02 100644 --- a/crates/bevy_ecs/hecs/src/query.rs +++ b/crates/bevy_ecs/hecs/src/query.rs @@ -322,8 +322,7 @@ pub struct Or(PhantomData); #[doc(hidden)] pub struct FetchOr(T); -/// Query transformer that skips entities that have a `T` component that has -/// not been mutated since the start of the frame. +/// Query transformer that retrieves components of type `T` that have been mutated since the start of the frame. /// Added components do not count as mutated. pub struct Mutated<'a, T> { value: &'a T, @@ -389,8 +388,7 @@ impl<'a, T: Component> Fetch<'a> for FetchMutated { } } -/// Query transformer that skips entities with a `T` component that has -/// not been added since the start of the frame. +/// Query transformer that retrieves components of type `T` that have been added since the start of the frame. pub struct Added<'a, T> { value: &'a T, } @@ -453,8 +451,7 @@ impl<'a, T: Component> Fetch<'a> for FetchAdded { } } -/// Query transformer that skips entities that have a 'T' component that has -/// not been either mutated or added since the start of the frame. +/// Query transformer that retrieves components of type `T` that have either been mutated or added since the start of the frame. pub struct Changed<'a, T> { value: &'a T, }