Esempio n. 1
0
        public override Card Evaluate(IAiContext context)
        {
            var cardSet = Child1.Evaluate(context);

            return(cardSet
                   .OrderByDescending(c => c.BaseCost).FirstOrDefault());
        }
        public override ResponseVotes Evaluate(IAiContext context)
        {
            var vote = context.AvailableResponses
                       .OfType <BuyCardResponse>()
                       .FirstOrDefault(response => (response.Item.Equals(Child1.Evaluate(context))));

            return(vote == null
                       ? new ResponseVotes()
                       : new ResponseVotes().VoteFor(vote, Child2.Evaluate(context)));
        }
Esempio n. 3
0
        public override bool Evaluate(IAiContext context)
        {
            var cardSet = Child1.Evaluate(context);
            var card    = Child2.Evaluate(context);

            if (cardSet == null || card == null)
            {
                return(false);
            }

            return(cardSet.Contains(card));
        }
Esempio n. 4
0
        public override bool Evaluate(IAiContext context)
        {
            if (Child1 == null || Child2 == null)
            {
                return(false);
            }

            var cardSet1 = Child1.Evaluate(context);
            var cardSet2 = Child2.Evaluate(context);

            if (cardSet1 == null || cardSet2 == null)
            {
                return(false);
            }

            return(Child1.Evaluate(context).IsSupersetOf(Child2.Evaluate(context)));
        }
Esempio n. 5
0
 public override ResponseVotes Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) ? Child2.Evaluate(context) : new ResponseVotes());
 }
Esempio n. 6
0
 public override bool Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) && Child2.Evaluate(context));
 }
        public override ResponseVotes Evaluate(IAiContext context)
        {
            var votes = new ResponseVotes();

            var matchingResponses = context.AvailableResponses.OfType<TRESPONSE>().Where(r => Child1.Evaluate(context).IsMatch(r));
            matchingResponses.ForEach(response => context.VoteFor(response, Child2.Evaluate(context)));
            return votes;
        }
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context).Count());
 }
Esempio n. 9
0
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(Child1.Evaluate(context).Where(c => c.IsTreasure)));
 }
Esempio n. 10
0
 public override T Evaluate(IAiContext context)
 {
     return((Child1.Evaluate(context)) ? Child2.Evaluate(context) : Child3.Evaluate(context));
 }
Esempio n. 11
0
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) + Child2.Evaluate(context));
 }
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(Child1.Evaluate(context).Where(c => c.CardType.Equals(Child2.Evaluate(context)))));
 }
Esempio n. 13
0
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context)
            .Count(c => Equals(c.CardType, Child2.Evaluate(context))));
 }
 public override CardSet Evaluate(IAiContext context)
 {
     return new CardSet(Child1.Evaluate(context).Where(c => c.IsVictory));
 }