Ejemplo n.º 1
0
        private void playCapture(Board io_GameBoard, ref string io_PositionFrom, ref string io_PositionTo, List <CheckersPiece> i_RivalPlayerPieces)
        {
            CheckersPiece checkerPieceToMove = null;
            CheckersPiece rivalCheckerPiece  = null;

            if (!IsComputer)
            {
                playerMustCapture(io_GameBoard, ref io_PositionFrom, ref io_PositionTo,
                                  ref checkerPieceToMove, i_RivalPlayerPieces, ref rivalCheckerPiece);
            }
            else
            {
                computerMustCapture(io_GameBoard, ref io_PositionFrom, ref io_PositionTo,
                                    ref checkerPieceToMove, i_RivalPlayerPieces, ref rivalCheckerPiece);
            }

            // Checks if there's an optional capture, and updating the data structure.
            MakeCapture(io_GameBoard, ref checkerPieceToMove, ref io_PositionTo, ref rivalCheckerPiece);
            checkerPieceToMove.GotToOtherSideOfBoard(ref io_GameBoard);
            // Remove checker piece from rival's soldiers.
            i_RivalPlayerPieces.Remove(rivalCheckerPiece);
        }
Ejemplo n.º 2
0
 public void MakeToolAKing(Board i_GameBoard, ref CheckersPiece io_CurrentCheckerPiece)
 {
     io_CurrentCheckerPiece.GotToOtherSideOfBoard(ref i_GameBoard);
 }