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); }
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); }