Ejemplo n.º 1
0
 private static void CountHandValues(uint handVal)
 {
     HandValue.Kind handType = HandValue.GetKind(handVal);
     _uniqHandValues[(int)handType].Add(handVal);
     // Count total as well
     _uniqHandValues[(int)HandValue.Kind._Count].Add(handVal);
 }
Ejemplo n.º 2
0
        public static string ValueToString(CardSet hand, UInt32 value)
        {
            StringBuilder result = new StringBuilder();

            HandValue.Kind handType = (HandValue.Kind)(value >> SHIFT_HANDTYPE);
            switch (handType)
            {
            case HandValue.Kind.HighCard:
                result.AppendFormat("High Card: {0}", CombinationToString(hand, value, 5));
                break;

            case HandValue.Kind.Pair:
                result.AppendFormat("Pair: {0}", CombinationToString(hand, value, 4));
                break;

            case HandValue.Kind.TwoPair:
                result.AppendFormat("2 Pair: {0}", CombinationToString(hand, value, 3));
                break;

            case HandValue.Kind.Trips:
                result.AppendFormat("3 of a Kind: {0}", CombinationToString(hand, value, 3));
                break;

            case HandValue.Kind.Straight:
                result.AppendFormat("Straight: {0}", StraightToString(hand, value));
                break;

            case HandValue.Kind.Flush:
                result.AppendFormat("Flush: {0}", FlushToString(hand, value, false));
                break;

            case HandValue.Kind.FullHouse:
                result.AppendFormat("Full House: {0}", CombinationToString(hand, value, 2));
                break;

            case HandValue.Kind.FourOfAKind:
                result.AppendFormat("4 of a Kind: {0}", CombinationToString(hand, value, 2));
                break;

            case HandValue.Kind.StraightFlush:
                result.AppendFormat("Straight Flush: {0}", FlushToString(hand, value, true));
                break;
            }
            return(result.ToString());
        }
Ejemplo n.º 3
0
 public void Count(UInt32 handVal)
 {
     HandValue.Kind handType = HandValue.GetKind(handVal);
     _handTypesCount[(int)handType]++;
     _handTypesCount[(int)HandValue.Kind._Count]++;  // Total.
 }