Exemple #1
0
        public new CardSetScore Score(CardSet set)
        {
            bool validate = colorValidator.Validate(set);

            return(!validate ?
                   new CardSetScore(Name) :
                   base.Score(set));
        }
        public new CardSetScore Score(CardSet set)
        {
            bool validate = colorValidator.Validate(set);
            var  score    = base.Score(set);

            return(validate && score.IsValid ?
                   new CardSetScore(Name, 9) :
                   new CardSetScore(Name));
        }
Exemple #3
0
        public CardSetScore Score(CardSet set)
        {
            bool isValid
                = validator.Validate(set);

            if (isValid)
            {
                return(new CardSetScore(Name, 5));
            }

            return(new CardSetScore(Name));
        }
Exemple #4
0
        public CardSetScore Score(CardSet set)
        {
            bool sameColor = colorValidator.Validate(set);

            if (!sameColor)
            {
                return(new CardSetScore(Name));
            }

            bool valid = set.Cards.All(Validate);

            return(valid ?
                   new CardSetScore(Name, 10) :
                   new CardSetScore(Name));
        }
Exemple #5
0
        public CardSetScore Score(CardSet set)
        {
            bool sameColor = colorValidator.Validate(set);

            if (!sameColor)
            {
                return(new CardSetScore(Name));
            }

            if (set.Cards
                .Select(card => card.Value)
                .Distinct()
                .ToList().Count != 5)
            {
                return(new CardSetScore(Name));
            }

            bool valid = set.Cards.All(Validate);

            return(valid ?
                   new CardSetScore(Name, 12) :
                   new CardSetScore(Name));
        }