public Hand(PokerEvaluator.PokerHands presetHand, List <Card> cards, int highCardValue = -1) { HighCard = highCardValue; HandType = presetHand; CardRankings = new List <int>(); cards.ForEach(a => CardRankings.Add(a.Order)); CardRankings.Sort(new CardComparerDesc()); if (presetHand <= PokerEvaluator.PokerHands.AHIGH) { highCardValue = (int)presetHand; } ConvertToReadable(cards); }
public Hand(PokerEvaluator.PokerHands presetHand, List <Card> cards, Card.Suits _suit, int highCardValue) { //Used for the flushes. Much easier passing the suit value then reworking it out again. HighCard = highCardValue; HandType = presetHand; CardRankings = new List <int>(); cards.ForEach(a => { if (a.Suit == _suit) { CardRankings.Add(a.Order); } }); if (CardRankings.Count < 5) { throw new Exception("Flush was passed to Hand constructor, but there were less than 5 valid cards for a flush"); } CardRankings.Sort(new CardComparerDesc()); if (presetHand <= PokerEvaluator.PokerHands.AHIGH) { highCardValue = (int)presetHand; } ConvertToReadable(cards); }