コード例 #1
0
    private void ConfirmButtonClicked()
    {
        if (SevenPlayer.PlayerSelectValue.Count != 5)
        {
            return;
        }

        PlayerScore = Rank.CurrentHandRankScore(SevenPlayer.PlayerSelectValue, SevenPlayer.PlayerSelectSuit);
        EndRound();
    }
コード例 #2
0
    private string GetAutoCompareHandScore(PlayerScript CurrentPlayer)
    {
        List <int>    TempValues        = new List <int>();
        List <string> TempSuits         = new List <string>();
        List <string> AllPossibleScores = new List <string>();

        for (int i = 0; i < this.AllPossibleHand.Count; i++)
        {
            TempValues.Clear();
            TempSuits.Clear();
            for (int j = 0; j < 5; j++)
            {
                TempValues.Add(CurrentPlayer.HandCardValues[AllPossibleHand[i][j]]);
                TempSuits.Add(CurrentPlayer.HandCardSuits[AllPossibleHand[i][j]]);
            }
            AllPossibleScores.Add(Rank.CurrentHandRankScore(TempValues, TempSuits));
        }
        string MaxScore = AllPossibleScores[0];

        for (int i = 1; i < 21; i++)
        {
            if (this.Rank.CompareRank(MaxScore, AllPossibleScores[i]) == 1)
            {
                continue;
            }
            else if (this.Rank.CompareRank(MaxScore, AllPossibleScores[i]) == 0)
            {
                continue;
            }
            else if (this.Rank.CompareRank(MaxScore, AllPossibleScores[i]) == -1)
            {
                MaxScore = AllPossibleScores[i];
            }
        }
        return(MaxScore);
    }