示例#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 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 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)));
        }
示例#4
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));
        }
        public override ResponseVotes Evaluate(IAiContext context)
        {
            var buyTreasureResponses =
                context.AvailableResponses.OfType <BuyCardResponse>().OrderByDescending(r => r.Item.Coins);

            if (buyTreasureResponses.Any())
            {
                return(context.VoteFor(buyTreasureResponses.First(), 1));
            }

            return(context.Votes);
        }
示例#6
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)));
        }
 public override int Evaluate(IAiContext context)
 {
     return(context.Game.NumberOfPlayers);
 }
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context).Count());
 }
示例#9
0
 public override int Evaluate(IAiContext context)
 {
     return(context.Actions);
 }
示例#10
0
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(Child1.Evaluate(context).Where(c => c.IsTreasure)));
 }
示例#11
0
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context)
            .Count(c => Equals(c.CardType, Child2.Evaluate(context))));
 }
示例#12
0
 public override bool Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) && Child2.Evaluate(context));
 }
示例#13
0
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(context.Hand.Where(c => c.IsAttack)));
 }
示例#14
0
 public override T Evaluate(IAiContext context)
 {
     return((Child1.Evaluate(context)) ? Child2.Evaluate(context) : Child3.Evaluate(context));
 }
示例#15
0
 public override int Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) + Child2.Evaluate(context));
 }
示例#16
0
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(context.CardsInPlay ?? new CardSet()));
 }
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(Child1.Evaluate(context).Where(c => c.CardType.Equals(Child2.Evaluate(context)))));
 }
 public override CardType Evaluate(IAiContext context)
 {
     return(Value);
 }
示例#19
0
 public override ResponseVotes Evaluate(IAiContext context)
 {
     return(Child1.Evaluate(context) ? Child2.Evaluate(context) : new ResponseVotes());
 }
示例#20
0
 public override int Evaluate(IAiContext context)
 {
     return(context.Buys);
 }
 public override CardSet Evaluate(IAiContext context)
 {
     return(new CardSet(context.Hand ?? new CardSet()));
 }
 public override CardSet Evaluate(IAiContext context)
 {
     return new CardSet(Child1.Evaluate(context).Where(c => c.IsVictory));
 }