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))); }
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); }
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()); }
public override int Evaluate(IAiContext context) { return(context.Actions); }
public override CardSet Evaluate(IAiContext context) { return(new CardSet(Child1.Evaluate(context).Where(c => c.IsTreasure))); }
public override int Evaluate(IAiContext context) { return(Child1.Evaluate(context) .Count(c => Equals(c.CardType, Child2.Evaluate(context)))); }
public override bool Evaluate(IAiContext context) { return(Child1.Evaluate(context) && Child2.Evaluate(context)); }
public override CardSet Evaluate(IAiContext context) { return(new CardSet(context.Hand.Where(c => c.IsAttack))); }
public override T Evaluate(IAiContext context) { return((Child1.Evaluate(context)) ? Child2.Evaluate(context) : Child3.Evaluate(context)); }
public override int Evaluate(IAiContext context) { return(Child1.Evaluate(context) + Child2.Evaluate(context)); }
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); }
public override ResponseVotes Evaluate(IAiContext context) { return(Child1.Evaluate(context) ? Child2.Evaluate(context) : new ResponseVotes()); }
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)); }