void Start()
    {
        Instance = this;
        int rows = 10, cols = 10;

        Model = GetComponent(typeof(MinesweeperModel)) as MinesweeperModel;
        Model.NewGame(rows, cols);
        //View = view;

        Status = GameStatus.Playing;
        // NewGame();
    }
Ejemplo n.º 2
0
        public void MinesweeperBoard_WithCorrectNumberOfMines_InitializesBoard()
        {
            int width = 50, height = 50, numMines = 100;
            MinesweeperController game = new MinesweeperController(width, height, numMines);
            var board                  = game.Board;
            var actualNumMines         = 0;

            for (var i = 0; i < width; i++)
            {
                for (var j = 0; j < height; j++)
                {
                    if (board[i, j].Type == CellType.Mined)
                    {
                        actualNumMines++;
                    }
                }
            }
            Assert.AreEqual(numMines, actualNumMines, "Wrong number of mines");
        }
 public void ThisController()
 {
     _controller = new MinesweeperController();
 }