public static Board MakeBoard() { var tileList = ShuffleTiles (MakeTiles ()).ToList(); // var tileList = MakeTiles().ToList(); // don't shuffle for testing var tiles = new Tile[4, 4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) { var t = tileList [0]; tileList.RemoveAt (0); tiles [i, j] = t; } return new Board (tiles); }
private Board Clone() { var newTiles = new Tile [4, 4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) newTiles [i, j] = Tiles [i, j].Clone (); return new Board (newTiles) { Moves = Moves.ToList() }; }
private Board(Tile[,] tiles) { Tiles = tiles; Moves = new List<Move> (); }