示例#1
0
        /// <summary>
        /// returns the most common face value in the player's hand
        /// </summary>
        /// <returns>returns an int representing the facevalue</returns>
        private int MostCommonInHand()
        {
            int[] hand       = VisibleHand.ArrayCountHand();
            int   mostCommon = -1;
            int   occurances = -1;

            for (int i = 1; i < hand.Length; i++)
            {
                if (hand[i] >= occurances)
                {
                    mostCommon = i + 1;
                    occurances = hand[i];
                }
            }
            return(mostCommon);
        }
示例#2
0
        /// <summary>
        /// Finds the most common bet FV in the last round of bets
        /// </summary>
        /// <returns>an int respresenting the facevalue</returns>
        private int MostCommonBet()
        {
            int[] faceValues = new int[VisibleHand.DiceType() - 1];
            faceValues[MostCommonInHand() - 2]++;
            foreach (int[] i in betsThisRound)
            {
                faceValues[i[1] - 2]++;
            }
            int mostCommon   = -1;
            int numberOfBets = -1;

            for (int i = 0; i < faceValues.Length; i++)
            {
                if (faceValues[i] >= numberOfBets)
                {
                    mostCommon   = i + 2;
                    numberOfBets = faceValues[i];
                }
            }
            return(mostCommon);
        }