Exemplo n.º 1
0
        private bool IsStraight(List <Card> cards, out List <Card> returnCards)
        {
            bool result = false;

            // get sequence of 5 consecutive cards if it exists
            returnCards = CardUtilities.GetConsecutiveValues(cards);
            if (returnCards.Count == 5)
            {
                result = true;
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool IsStraightFlush(List <Card> cards, out List <Card> returnCards)
        {
            bool result = false;

            // get sequence of 5 consecutive cards if it exists
            returnCards = CardUtilities.GetConsecutiveValues(cards);
            if (returnCards.Count == 5)
            {
                var suits = returnCards.Select(x => x.Suit).Distinct().ToArray();
                if (suits.Length == 1)
                {
                    result = true;
                }
            }
            return(result);
        }