JoJoJet / bevy-trait-query

adds trait queries to the bevy game engine
Apache License 2.0
90 stars 16 forks source link

Code reorganization to facilitate planned `Added/Changed` extensions #29

Closed bzm3r closed 1 year ago

bzm3r commented 1 year ago

lib.rs is becoming quite unwieldy with the new extensions planned to Added/Changed: for instance, there will be new WorldQuery adapters, ReadTraits iterators, and new WriteTraits iterators. In order to make the file easier to navigate, and thereby mitigate the risk of errors, I think it will be useful to reorganize the code

bzm3r commented 1 year ago

@JoJoJet ah, one and all will be the files that will grow the most in the upcoming changes. multiple_read and multiple_write will also see significant growth.

What I can do is keep this PR open, and work on the added/changed stuff. Once that PR is up, you'll have more information as to how things ought to be organized?

bzm3r commented 1 year ago

Okay, because it seemed that I can keep the singular_* files small even after change detection, I've collapsed them into one.

But can have you a look at how multiple_read and multiple_write change here, and then decide whether they should still be collapsed: https://github.com/JoJoJet/bevy-trait-query/pull/30

JoJoJet commented 1 year ago

I will leave the decision up to you, but IMO it's fine to just merge those files. all.rs will be quite long, but that's okay.

JoJoJet commented 1 year ago

So, apparently cargo-rdme doesn't like re-exports, so that doc link on line 167 of lib.rs needs to be crate::one::One

JoJoJet commented 1 year ago

Github won't let me push to this branch, so I'm just going to go ahead and merge this, then apply my nitpicks in a follow-up PR.