I want to iterate over a List in a 2D way, basically starting at the center and working my way around in a "circular" fashion. The List is a List of type Chunk and Chunks store a Vector 3 position. I also have a Player which has a Vector3 position. I want to generate the chunks closest to the Player first.
I have considered sorting the list by comparing the position of the chunks to the player position, but I can't even imagine a way to store all of them in a closest, next closest, next closest, etc fashion.
Can I get some sudo code to help me accomplish this?