public void endPlayerTurn()
    {
        isPlayerTurn = false;
        Board pieces        = boardManager.pieces;
        Move  bestMoveForAi = ChessAI.getBestMove(pieces);

        Debug.Log(bestMoveForAi.start.x + "," + bestMoveForAi.start.y);
        //boardManager.movePiece(bestMoveForAi.start, bestMoveForAi.end);
        isPlayerTurn = true;
    }
Exemplo n.º 2
0
    public int[] decideAndMoveEnemyPiece()
    {
        int[] ai_move = new int[4];

        Move bestMoveForAi = ChessAI.getBestMove(pieces);

        Debug.Log(bestMoveForAi.start.x + "," + bestMoveForAi.start.y + "to" + bestMoveForAi.end.x + "," + bestMoveForAi.end.y);
        movePiece(bestMoveForAi.start, bestMoveForAi.end, true);
        ai_move[0] = bestMoveForAi.start.x;
        ai_move[1] = bestMoveForAi.start.y;
        ai_move[2] = bestMoveForAi.end.x;
        ai_move[3] = bestMoveForAi.end.y;

        return(ai_move);
    }