static public TList <Tile> GetTiles(Extent ex, int zL) { TList <Tile> output = new TList <Tile>(); Tile upperLeft = GetTile(ex.UL, zL, -1, -1); Tile bottomRight = GetTile(ex.BR, zL, +1, +1); List <int> rows = Enumerable.Range(upperLeft.Row, bottomRight.Row - upperLeft.Row).ToList(); List <int> cols = Enumerable.Range(upperLeft.Col, bottomRight.Col - upperLeft.Col).ToList(); output.Rows = rows.Count(); output.Columns = cols.Count(); foreach (int c in cols) { foreach (int r in rows) { output.Add(new Tile(r, c, zL, rows.IndexOf(r), cols.IndexOf(c))); } } if (output.Count() > 2000) { Console.WriteLine("TOO BIG"); output = GetTiles(ex, zL - 1); } return(output); }