public GameBoardGraphicsCP(IGamePackageResolver mainContainer, GameBoardVM clickModel, MancalaVMData dataModel, CommandContainer command ) : base(mainContainer) { _clickModel = clickModel; _dataModel = dataModel; _command = command; }
public void Test_ClearRow() { GameBoardVM board = FillGameGrid(); board.ClearRow(0); for (int i = 0; i < board.Grid.GetLength(1); i++) { Assert.AreEqual(board.Grid[0, i], 0); } }
GameBoardVM FillGameGrid() { GameBoardVM board = SetUpGameBoard(); for (int i = 0; i < board.Grid.GetLength(0); i++) { for (int j = 0; j < board.Grid.GetLength(1); j++) { board.Grid[i, j] = 1; } } return(board); }
public void Test_ClearGrid() { GameBoardVM board = FillGameGrid(); board.ClearGrid(); for (int i = 0; i < board.Grid.GetLength(0); i++) { for (int j = 0; j < board.Grid.GetLength(1); j++) { Assert.AreEqual(board.Grid[i, j], 0); } } }
public IGameBoardVM CreateInstance(Difficulty difficulty) { var gameBoard = _puzzleGenerator.GeneratePuzzle(difficulty); var cells = new List<ICellVM>(); for (int i = 0; i < gameBoard.Fields.Length; i++) { var value = gameBoard.Fields[i]; if (value != 0) { cells.Add(new FixedCellVM(i, value)); } else { cells.Add(new ChangeableCellVM(i)); } } var gameBoardVM = new GameBoardVM(gameBoard, cells); return gameBoardVM; }
GameBoardVM SetUpGameBoard() { GameBoardVM board = new GameBoardVM(); return(board); }