I have a grid, which the user can expand as he wishes. Since I don't know how big the grid will end up (and many tiles will stay empty) a two dimensional array (
Tile gird) wouldn't work. But I feel like just adding Tiles to a list (
List<Tile> grid) can't be the best way, since when I want to get a Tile I have to search for it every time (
grid.SingleOrDefault(t => t.x == _x && t.y == _y)). Which is ofcourse not ideal.
Is there a method which e.g. sorts the
List<Tile> in a way that it's faster to accesss a given tile?