Skip to content

Add queries that filter based on change detection #42

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 55 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
29cf7c7
Code reorganization.
Dec 10, 2022
7f5d427
Collapse one and singular_*
Dec 10, 2022
d7f205f
Collapse all and multiple_*
Dec 11, 2022
87733ba
Remove unnecessary things from change detection.
Dec 10, 2022
5d9c01a
Singular read write change detection.
Dec 10, 2022
6d440ae
Multple read change detection.
Dec 10, 2022
161a694
Multiple write change detection.
Dec 10, 2022
9a9bdcc
Simple tests for AddedOne/ChangedOne
Dec 10, 2022
8d7cca9
Clippy + fmt.
Dec 10, 2022
9bf9d2f
Changed/added filters for One
Dec 26, 2022
6e157d2
Added some more docs.
Dec 26, 2022
5089dde
Docs + tests + bug-fixes
Dec 26, 2022
e570f74
Merge branch 'main' into pr/30
joseph-gio May 27, 2023
fe5aec9
resolve merge conflicts in one.rs
joseph-gio May 27, 2023
55ac0cf
fix merge conflicts in all.rs
joseph-gio May 27, 2023
96df5a0
fix merge conflicts for `change_detection.rs`
joseph-gio May 27, 2023
ddfdd0f
update tests
joseph-gio May 27, 2023
59bc2a0
rename change_detection.rs to query_filter.rs
joseph-gio May 27, 2023
2727631
fix tick naming convention
joseph-gio May 27, 2023
e1e7b27
fix a copy-paste error
joseph-gio May 27, 2023
6628ea3
make run order deterministic for a unit test
joseph-gio Jun 16, 2023
09d732a
reorder a unit test
joseph-gio Jun 16, 2023
0dfefbd
make another test deterministic
joseph-gio Jun 16, 2023
eedb296
Apply suggestions from code review
joseph-gio Jun 28, 2023
7251f45
rustfmt
joseph-gio Jun 28, 2023
a64b679
fix a syntax error with Self::Fetch
joseph-gio Jun 28, 2023
9c4bd99
replace recursion with loops
joseph-gio Jun 28, 2023
2de3481
`usize` -> `TableRow`
joseph-gio Jun 28, 2023
c8f27b5
Merge branch 'main' into change-detection-rebase
joseph-gio Jun 29, 2023
682060f
use `UnsafeWorldCell`
joseph-gio Jun 29, 2023
0ce1e5c
return `Ref` from trait queries
joseph-gio Jun 29, 2023
b0056b3
turn change detection queries into adapters over the base forms
joseph-gio Jun 29, 2023
f013ed2
yeet DynQueryState
joseph-gio Jun 30, 2023
65cca11
fix change ticks for read-only queries
joseph-gio Jul 1, 2023
20114a9
deduplicate worldquery impls
joseph-gio Jul 1, 2023
f87c678
unify fetch structs
joseph-gio Jul 1, 2023
e3c9c6c
fix safety comment formatting
joseph-gio Jul 15, 2023
4f7aa12
remove lifetimes from `One` filters
joseph-gio Jul 15, 2023
6f2fbfa
document `One` filters
joseph-gio Jul 15, 2023
6e81b19
remove `One` hybrid filter queries
joseph-gio Jul 15, 2023
c0f349b
return `Ref` from `One` queries
joseph-gio Jul 15, 2023
c515851
unify fetch structs for `One`
joseph-gio Jul 15, 2023
99ee8a4
shorten names of `One` filters
joseph-gio Jul 15, 2023
235d66d
update some leftover usages
joseph-gio Jul 15, 2023
312f304
rename `All` filters
joseph-gio Jul 15, 2023
4ce2c46
reorder `All` adapters
joseph-gio Jul 15, 2023
d4cc51c
remove a doctest
joseph-gio Jul 16, 2023
a75be23
compile doctests
joseph-gio Jul 16, 2023
e023b8f
add some hidden code
joseph-gio Jul 16, 2023
c108884
remove the `query_filter` module
joseph-gio Jul 16, 2023
4b426e7
move a type alias
joseph-gio Sep 8, 2023
f6f8abc
replace adapters with filter methods
joseph-gio Sep 8, 2023
f333023
fix imports
joseph-gio Sep 8, 2023
e55f73d
update some docs
joseph-gio Sep 8, 2023
122e674
fix proc macros
joseph-gio Sep 8, 2023
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
6 changes: 3 additions & 3 deletions proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>

let my_crate = proc_macro_crate::crate_name("bevy-trait-query").unwrap();
let my_crate = match my_crate {
proc_macro_crate::FoundCrate::Itself => quote! { crate },
proc_macro_crate::FoundCrate::Itself => quote! { bevy_trait_query },
proc_macro_crate::FoundCrate::Name(x) => {
let ident = quote::format_ident!("{x}");
quote! { #ident }
Expand Down Expand Up @@ -156,7 +156,7 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
#where_clause
{
type Item<'__w> = #my_crate::ReadTraits<'__w, #trait_object>;
type Fetch<'__w> = #my_crate::ReadAllTraitsFetch<'__w, #trait_object>;
type Fetch<'__w> = <#my_crate::All<&'__a #trait_object> as #imports::WorldQuery>::Fetch<'__w>;
type ReadOnly = Self;
type State = #my_crate::TraitQueryState<#trait_object>;

Expand Down Expand Up @@ -264,7 +264,7 @@ fn impl_trait_query(arg: TokenStream, item: TokenStream) -> Result<TokenStream2>
#where_clause
{
type Item<'__w> = #my_crate::WriteTraits<'__w, #trait_object>;
type Fetch<'__w> = #my_crate::WriteAllTraitsFetch<'__w, #trait_object>;
type Fetch<'__w> = <#my_crate::All<&'__a #trait_object> as #imports::WorldQuery>::Fetch<'__w>;
type ReadOnly = &'__a #trait_object;
type State = #my_crate::TraitQueryState<#trait_object>;

Expand Down
Loading