private void addFlush(IEnumerable <Card> cards) { //If not already in another flush if (Flush != null && Flush.Cards.Intersect(cards).Any()) { return; } Details.Add(ScoreDetail.CreateFlush(cards)); }
private void addThreeOfAKind(IEnumerable <Card> cards) { //If not already in a four of a kind if (FourOfAKind != null && FourOfAKind.Cards.Intersect(cards).Any()) { return; } Details.Add(ScoreDetail.CreateThreeOfAKind(cards)); }
private void scoreNibs() { foreach (var card in _justTheHand) { if (card.IsJack && card.Suit == _cards[4].Suit) { Details.Add(ScoreDetail.CreateNibs(card)); } } }
private void addRun(IEnumerable <Card> cards) { bool allCardsInAnotherRun = false; //If not already in another run Runs.ForEach(r => { if (cards.All(c => r.Cards.Contains(c))) { allCardsInAnotherRun = true; return; } }); if (!allCardsInAnotherRun) { Details.Add(ScoreDetail.CreateRun(cards)); } }
private void addFifteen(IEnumerable <Card> cards) { Details.Add(ScoreDetail.CreateFifteen(cards)); }
private void addFourOfAKind(IEnumerable <Card> cards) { Details.Add(ScoreDetail.CreateFourOfAKind(cards)); }