Esempio n. 1
0
    protected void NextMove()
    {
        if (isTrainingGame)
        {
            activeGameAgent = activeGameAgent.opponent;
            switch (activeGameAgent.GetPlayer())
            {
            case GameAgent.Player.agent:
                activeGameAgent.RequestMove();
                break;

            case GameAgent.Player.human:
                //wait for input
                break;

            case GameAgent.Player.random:
                DoMove(GetPossibleMoves(board, activeGameAgent).GetRandom());
                break;
            }
        }
        else
        {
            StartCoroutine(NextMoveCoroutine());
        }
    }
Esempio n. 2
0
    protected IEnumerator NextMoveCoroutine()
    {
        activeGameAgent = activeGameAgent.opponent;
        yield return(new WaitForSeconds(0.1f));

        switch (activeGameAgent.GetPlayer())
        {
        case GameAgent.Player.agent:
            activeGameAgent.RequestMove();
            break;

        case GameAgent.Player.human:
            //wait for input
            break;

        case GameAgent.Player.random:
            DoMove(GetPossibleMoves(board, activeGameAgent).GetRandom());
            break;
        }
        yield break;
    }