I got a two dimensional Array
BoardTile tiles[,];
and then in Init(Point size) I set its size:
tiles = new BoardTile[size.X, size.Y];
And how do I initialize all those elements because it does not use default BoardTile() constructor. It just assigns null.
foreach(BoardTile t in tiles) t = new BoardTile()
Does not work. And when I try to call
foreach(BoardTile t in tiles) t.anything()
I get NullReferenceException.
foreachis introduced for enumerating collections