Ralith / hypermine

A hyperbolic voxel game
Apache License 2.0
160 stars 20 forks source link

Simplify and document expansion functions of Graph #413

Closed patowen closed 3 months ago

patowen commented 4 months ago

This PR accomplishes a few things, all in the spirit of hopefully reducing the mental load of understanding all the algorithms that allow Graph to grow:

patowen commented 4 months ago

I believe some of the comments I've written don't make sense, although it's hard to tell in what way they don't make sense and how to improve them, so I hope that peer review will help here.

Ralith commented 4 months ago

Great improvement overall! I don't think I ever actually understood this logic, so this clarity is striking.

patowen commented 4 months ago

Ah, the "Compare" button isn't as useful this time because it also includes all the changes from master that were included. I'll list out the changes I made:

patowen commented 4 months ago

I realize that my note about calling ensure_neighbor instead of neighbor was unnecessarily verbose for what is already a long and dense explanation, so I replaced it with the (and recursively create if needed) parenthetical, which accomplishes the same thing in far fewer words.