コード例 #1
0
    void ComputerTurn()
    {
        ComputerPlayer.Move compMove = computerPlayer.FindBestMove(buttonList2D);
        buttonList2D[compMove.row, compMove.col].text = computerSide;
        buttonList2D[compMove.row, compMove.col].GetComponentInParent <Button>().interactable = false;

        EndTurn();
    }
コード例 #2
0
ファイル: ViewModel.cs プロジェクト: teekenl/Gin-Rummies-F-
        private void ComputerDiscardCardFromHand()
        {
            if (humanDiscard)
            {
                ComputerPlayer.Move move    = ComputerPlayer.ComputerMove(ComputerCards).Item1;
                Cards.Card          discard = ComputerPlayer.ComputerMove(ComputerCards).Item2.Value;
                Discards.Add(discard);
                ComputerCards.Remove(discard);
                humanDiscard = false;
                playerTurn   = true;

                if (move == ComputerPlayer.Move.Gin)
                {
                    endGame();
                }
                else if (move == ComputerPlayer.Move.Knock)
                {
                    endGame();
                }
            }
        }