I'm trying to simulate a boardgame what can be played on a board with an arbitrary lattice, anything from triangles to heptagons to 37-sided regular polygons is allowed. Moreover the shape of the board is also arbitrary.
I need to represent this board in a data structure in which each tile has as its property a list of all its neighbouring tiles.
I was wondering if there is already some work done related to this that I might find helpful?
The way I'm trying to approach this problem is as follows: I first devise a coordinate system. Then I situate the virtual board within the coordinate system. Then I lay down the first tile and recursively lay down all neighbouring tiles until I cross the border. The approach is quite ugly and there is some uncertainty involved as I'm using angles and such to figure out the coordinates of each tile and it's all very messy. There must surely be a better way.