Exemple #1
0
        public void EvaluateHand_ReturnsRoyalFlush()
        {
            var hand = new List <Card>
            {
                new Card {
                    Suit = CardSuit.SPADE, Rank = CardRank.KING
                },
                new Card {
                    Suit = CardSuit.SPADE, Rank = CardRank.JACK
                },
                new Card {
                    Suit = CardSuit.SPADE, Rank = CardRank.ACE
                },
                new Card {
                    Suit = CardSuit.SPADE, Rank = CardRank.QUEEN
                },
                new Card {
                    Suit = CardSuit.SPADE, Rank = CardRank.TEN
                }
            };

            var result = _handEvaluator.EvaluateHand(hand);

            Assert.IsTrue(result == HandValue.ROYAL_FLUSH);
        }
Exemple #2
0
 private Hand UpdateCurrentHand()
 {
     return(new Hand
     {
         Cards = _currentSelection,
         Value = _handEvaluator.EvaluateHand(_currentSelection),
         Size = _currentSelection.Count
     });
 }
Exemple #3
0
 // 4.
 public void EvaluateHand()
 {
     if (Cards.Count >= 5)
     {
         var eval = _eval.EvaluateHand(Cards);
         BestCards.AddRange(eval.Cards);
         HandValue = eval.HandValue;
         Suit = eval.Suit;
     }
 }
        public void EvaluateHand()
        {
            if (Cards.Count < 2)
            {
                return;
            }
            BestCards.Clear();
            HighCards.Clear();
            var result = _eval.EvaluateHand(Cards);

            BestCards.AddRange(result.Cards);
            HighCards.AddRange(result.HighCards);

            HandValue = result.HandValue;
            Suit      = result.Suit;
        }