예제 #1
0
 /// <summary>
 ///  Metoda klasy ViewModel resetujaca canvas
 /// </summary>
 public void resetGrid()
 {
     board.Children.Clear();
     gameOfLifeModel.clearGrid(gameOfLifeModel.cells);
     gameOfLifeModel.clearGrid(gameOfLifeModel.cellsNextGen);
     // gameOfLifeModel.PaintGrid();
 }
예제 #2
0
        public void clearGrid__Test()
        {
            Canvas cvs = new Canvas();

            // gridSize , deadToLive , liveStillLive , Canvas
            GameOfLife.Model mc = new GameOfLife.Model(10, "3", "23", cvs);

            bool bfr = true;

            mc.cells[0, 1].isAlive = true;
            mc.cells[1, 1].isAlive = true;
            mc.cells[2, 1].isAlive = true;

            mc.clearGrid(mc.cells);

            foreach (var item in mc.cells)
            {
                bfr = item.isAlive;
            }

            Assert.IsTrue(bfr == false);
        }