Re-posting this from my feedback thread where I am requesting 2D Arrays:
Here is how I approximated a 2D array in order to implement a system to store groups of tiles for landmasses and bodies of water:
So the above starts with 1 tile index from map in the Open List. Then I neighbor check his 6 neighbors and each neighbor sharing a tile type gets added to the open list. This continues until each like tile in the landmass or body of water is put into the closed list. When that is complete I dump the closed list into an array and add 100,000 multiplied by the multiplier. The multiplier starts at 1 and increments by 1 every time the closed list gets dumped. So the first lake would have tiles that look like 1XX,XXX, the second 2XX,XXX, etc. The reason I use 100,000 is because the upper range for map indexes is over 10,000, and the highest number is what I use to track which lake I am looking at.
With each lake serialized into an array I need a way to retrieve that information:
I have Current Index which is whatever tile I want to look at. I go through my entire Water Body Array, divide it by the 100,000, and match the remainder to my Current Index. Then I know I have the right lake, so I set that to the Current Landmass/Body of Water for use in:
Since I now know what lake I am looking for, I use that info to pull all the tiles of that lake from the Water Body Array and dump them into my Lake Array.