Exemple #1
0
        internal override void Evaluate(Hand hand)
        {
            bool isFlush = HandEvaluatorHelper.IsFlush(hand);

            if (isFlush)
            {
                Console.WriteLine("It is Flush!");
            }
            else
            {
                this.Successor.Evaluate(hand);
            }
        }
Exemple #2
0
        private bool IsRoyalFlush(Hand hand)
        {
            bool isFlush = HandEvaluatorHelper.IsFlush(hand);

            if (!isFlush)
            {
                return(false);
            }

            var cardsValues = new HashSet <CardValue>(hand.Cards.Select(card => card.Value));

            return(cardsValues.SetEquals(this.NeededCardValues));
        }
        internal override void Evaluate(Hand hand)
        {
            bool isStraight = HandEvaluatorHelper.IsStraight(hand);

            if (isStraight)
            {
                Console.WriteLine("It is Straight!");
            }
            else
            {
                // since there is no successor yet
                Console.WriteLine("It is lower than Straight!");
            }
        }