I'm making a game using in C# and Javascript that uses a map which havehas tiles, corners and borders. Here's a graphical representation:
Tiles, Borders and Corners http://img543.imageshack.us/img543/2180/tileso.png
I've managed to store tiles and corners in memory but I'm having troubles to gettrouble getting the borders structured.
For the tiles, I have a [Map Width * Map Height]Map Width * Map Height sized array. For corners I have [(Map Width + 1) * (Map Height + 1)](Map Width + 1) * (Map Height + 1) sized array.
I've
I've already made up the math needed to access corners from a tile, but I can't figure out how to store and access the borders from a single array.
Tiles store thetheir type (and other game logic variables) and via the array index I can get the X, and Y coordinates. ViaFrom this tile position it is possible to get the array index of the corners (which store the Z index).
The borders will store a game object and accessing corners from only border info would be also required.
If someone even has a better way to store these for better memory and performance I would gladly accept that.
EDIT: Using in C# and Javascript.