Hey guys,
If you want to use a 2d List of something like tiles for a Tile map, I wrote a fun solution that makes a wrapper around a 1d List and allows you to work with them as if they it were a 2d List with a minor change in notation for accessing elements.
Using my class, you can create a 2d map of tiles like this:
**public Map map = new Map();**
Add lists of tiles (rows) to the map like this:
**map.Add(row);**
Then get and set elements on the map like this:
**Tile aTile = map[1,0];**
**map[2,3] = aTile;**
Here's the Map class:
![alt text][1]
[1]: /storage/temp/54604-screen-shot-2015-09-19-at-20606-pm.png
↧