Repository navigation
It's documentation time - #78
AsterixxxGallier wants to merge 13 commits into
Conversation
giantcow
left a comment
There was a problem hiding this comment.
Didn't have a tonne of time to look through this, but put down a few comments
In general, I think some of the additions are useful to add context (especially for me coming in new to this project), but there are a significant number of internal comments (//) that are just stating what a single line is doing... I'd suggest avoiding those as they tend to just add bloat
| /// queried via the `archetype_has_component` function. | ||
| pub(crate) fn matches_archetype<F>(&self, mut archetype_has_component: F) -> bool |
There was a problem hiding this comment.
mega-nit:
| /// queried via the `archetype_has_component` function. | |
| pub(crate) fn matches_archetype<F>(&self, mut archetype_has_component: F) -> bool | |
| /// queried via the given function. | |
| pub(crate) fn matches_archetype<F>(&self, mut does_archetype_have_component: F) -> bool |
| let empty = self.empty_mut(); | ||
|
|
||
| let rellocated = unsafe { empty.reserve_one() }; | ||
| // Reserve space for the spawned entity. |
There was a problem hiding this comment.
This should probably have a // SAFETY comment
| // Remove the archetype. | ||
| let mut arch = self.archetypes.remove(arch_idx.0 as usize); |
There was a problem hiding this comment.
Don't think this comment is adding any value over the method name
| // The archetype already exists, insert it into the | ||
| // map and return it. | ||
| *vacant_insert_components.insert(*entry.get()) |
There was a problem hiding this comment.
Don't think this is comment is adding any value, it just restates how insert works
I documented all over the place!
Specifically these modules:
accessarchetypebit_setcomponententitiesevent(and submodules)fetchhandlerworldAll public API was already documented, but not many internal functions. I added docs for most of them. I also added comments inside of some functions to explain their implementation. I added notes and TODOs whenever I saw something that I thought could be improved or optimized. However, apart from one test I added, the code itself was left untouched - no functionality changed, not even implementation details.
I hope this makes the codebase more navigable and understandable. I'm open to feedback, additions, changes and critique!