예제 #1
0
    /// <summary>
    /// Toggles whose turn it is.
    /// </summary>
    public void NextTurn()
    {
        currentPlayerTurn++;
        if (currentPlayerTurn > numberOfPlayers)
        {
            currentPlayerTurn = 1;
        }
        stonesRemaining = stonesPerPlay;

        // update displays:

        goban.ChangePlayerTurn(currentPlayerTurn);
        if (dummyObject)
        {
            dummyObject.ChangePlayerTurn(currentPlayerTurn);
        }

        // OPPONENT_AUTO_TAKE_TURN
        if (currentPlayerTurn != localPlayer && move_tree != null)
        {
            if (move_tree.branches == null || move_tree.branches.Length == 0)
            {
                //Debug.Log("No info for ai");
            }
            else
            {
                var nextMove = move_tree.branches[0];
                if (nextMove != null)
                {
                    PlayStoneAt(nextMove.x, nextMove.y);
                }
            }
        }
        goban.Display(data);
    }