/// <summary> /// This method applies a move on the logical part of the board and applies its consequences to the UI /// </summary> /// <see cref="Move"/> /// <param name="move">The move object containing the position played at and the pawns to modify</param> private void PlayMove(Move move) { int score = 0; List <Point> cellsPosInvert = move.GetChecksToInvert(); logicalBoard.ApplyMove(move); score++; foreach (Point point in cellsPosInvert) { score++; } if (move.whitePlayer) { ScoreWhite += score; ScoreBlack -= score - 1; } else { ScoreBlack += score; ScoreWhite -= score - 1; } }
/// <summary> /// Apply and returns a new board state with the given move. /// </summary> /// <param name="move">Move object to apply</param> /// <returns>A new node with the board calculated</returns> public MiniMaxTreeNode ApplyMove(Move move) { int[,] dataCopy = (int[, ])Data.Clone(); LogicalB.ApplyMove(dataCopy, move); return(new MiniMaxTreeNode(dataCopy, !whitePlayer)); }