Ejemplo n.º 1
0
        //Tell the player to randomly give the opposing player a piece
        static void RandomGivePiece(ref Player picker, ref Player receiver, ref Board board, ref AvailablePieces available)
        {
            Piece p = picker.ai.RandomPickPiece(board, available);

            receiver.selectedPiece = p;
            picker.Turns          += 1;
            available.RemovePiece(p);
            ChangeTurns(ref picker, ref receiver);
        }
Ejemplo n.º 2
0
        //Tell player to play a piece on the board (MinMax)
        static Piece PlayPiece(ref Player player, ref Board board, ref AvailablePieces available)
        {
            object[] play       = player.ai.MinMaxPlay(board, player.selectedPiece, available, 2, 0, false);
            int[]    location   = (int[])play[0];
            Piece    piece_play = (Piece)play[1];

            board.SetPiece(player.selectedPiece, location[0], location[1]);
            player.Turns        += 1;
            player.selectedPiece = null;
            if (piece_play != null)
            {
                available.RemovePiece(piece_play);
            }
            return(piece_play);
        }