public bool Analyze(IEnumerable <HandHistories.Objects.Cards.Card> playerCards, BoardCards boardCards) { if (playerCards == null || boardCards == null || playerCards.Count() != 2 || boardCards.Count() < 3) { return(false); } var allCards = boardCards.ToList(); allCards.AddRange(playerCards); if (HandAnalyzerHelpers.IsPair(playerCards, 1) || !HandAnalyzerHelpers.IsNofKind(allCards, 3)) { return(false); } var flopCards = boardCards.GetBoardOnStreet(Street.Flop); var flopPair = boardCards.GroupBy(x => x.Rank).FirstOrDefault(x => x.Count() == 2); if (flopPair != null) { return(flopPair.Any(f => playerCards.Any(p => p.CardIntValue == f.CardIntValue))); } return(false); }
public bool Analyze(IEnumerable <HandHistories.Objects.Cards.Card> playerCards, BoardCards boardCards) { if (!HandAnalyzerHelpers.IsFlushDraw(playerCards, boardCards, 1)) { return(false); } var drawSuit = boardCards.GroupBy(x => x.Suit).FirstOrDefault(x => x.Count() == 3).Key; return((drawSuit != null) && HandAnalyzerHelpers.IsTopKicker(playerCards.OrderByDescending(x => x.RankNumericValue).First(x => x.Suit == drawSuit), boardCards.Where(b => b.Suit == drawSuit))); }
public bool Analyze(IEnumerable <Cards.Card> playerCards, BoardCards boardCards) { if (playerCards == null || boardCards == null || playerCards.Count() != 2 || boardCards.Count() == 0) { return(false); } if (!HandAnalyzerHelpers.IsPair(playerCards, 1)) { return(false); } return(boardCards.GroupBy(x => x.Rank).Any(g => (g.Count() == 2) && (g.Key == playerCards.First().Rank))); }
public bool Analyze(IEnumerable <HandHistories.Objects.Cards.Card> playerCards, BoardCards boardCards) { if (playerCards == null || boardCards == null || playerCards.Count() != 2 || boardCards.Count() == 0) { return(false); } if (HandAnalyzerHelpers.IsPair(playerCards, 1)) { return(false); } var trips = boardCards.GroupBy(x => x.Rank).FirstOrDefault(x => x.Count() == 3); if (trips != null) { return(playerCards.Any(x => x.Rank == trips.Key)); } return(false); }