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))); }
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 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 ResponseVotes Evaluate(IAiContext context) { return(Child1.Evaluate(context) ? Child2.Evaluate(context) : new ResponseVotes()); }
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()); }
public override CardSet Evaluate(IAiContext context) { return(new CardSet(Child1.Evaluate(context).Where(c => c.IsTreasure))); }
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(Child1.Evaluate(context).Where(c => c.CardType.Equals(Child2.Evaluate(context))))); }
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)); }