Update based on Jesse C. Slicer feedback:
class Board
{
public Tile[,] Tiles { get; private set; }
private int Size { get; set; }
public void StartGame()
{
Size = 3;
Tiles = new Tile [Size,Size];
This part I am not sure if it is done correctly
private void FillTiles()
{
Tile k = new Tile(0);
int temp = 0;
for (int i = 0; i < Size; i++)
{
for (int j = 0; j < Size; j++)
{
Tiles[i, j] = k;
temp++;
k = new Tile(temp);
}
}
}
Changed int temp = Tiles[i0, i1];
to Tile temp = Tiles[i0, i1];
Other changes such as var flattedList = Tiles.OfType<Tile>().ToList();
for the flatted list.
The code works like before with the changes made to it.