Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 private void scoreNibs()
 {
     foreach (var card in _justTheHand)
     {
         if (card.IsJack && card.Suit == _cards[4].Suit)
         {
             Details.Add(ScoreDetail.CreateNibs(card));
         }
     }
 }
Exemple #4
0
        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));
            }
        }
Exemple #5
0
 private void addFifteen(IEnumerable <Card> cards)
 {
     Details.Add(ScoreDetail.CreateFifteen(cards));
 }
Exemple #6
0
 private void addFourOfAKind(IEnumerable <Card> cards)
 {
     Details.Add(ScoreDetail.CreateFourOfAKind(cards));
 }