示例#1
0
    public void RunBotMove()
    {
        //computer's turn to go
        if ((int)player != (int)playerTurn)
        {
            State.Type startType;
            if (player == Player.Black)
                startType = State.Type.Max;
            else
                startType = State.Type.Min;

            decisionTree = new DecisionTree(currentState, startType);
            //Debug.Log("Bot Decisions:\n\n");
            foreach(State s in decisionTree.GetRoot().childrenStates)
            {
                //s.LogState();
                //Debug.Log("\n\n");
            }

            State decision = decisionTree.MakeDecision();

            //Debug.Log("Bot Decision");
            //Debug.Log("Decision Row: " + decision.newValueRow);
            //Debug.Log("Decision Col: " + decision.newValueCol);
            //Debug.Log("Decision score: " + decision.score);
            //decision.LogState();

            BoardGenerator.boardCells[decision.newValueRow, decision.newValueCol].disc = DropDisc(decision.newValueRow, decision.newValueCol,
                                                                                                  ref BoardGenerator.boardCells[decision.newValueRow, decision.newValueCol]);
        }
        //playerCanGo = true;
    }