示例#1
0
 public override Card GetLead(DealView dealInProgress)
 {
     // who cares, just lead whatever
     return this
         .GetLeadableCards(dealInProgress)
         .Choose();
 }
 public static IEnumerable<Card> GetLeadableCards(this PlayerBase player, DealView dealInProgress)
 {
     var validator = new LeadValidator(dealInProgress);
     return player
         .CardList
         .Where(c => validator
             .Validate(new Play(c, player))
             .IsValid)
         .OrderBy(c => c.Suit)
         .ThenBy(c => c.Rank);
 }
示例#3
0
 public override Card GetPlay(DealView dealInProgress, TrickView trickInProgress)
 {
     var cards = this.GetPlayableCards(trickInProgress);
     // if there are point cards, attempt to duck the trick
     var highCard = trickInProgress.WinningPlay.Card;
     if (trickInProgress.HasPointCards &&
         cards.Any(c => c.IsOutrankedBy(highCard)))
     {
         cards = cards.OutrankedBy(highCard);
     }
     return cards.First();
 }
示例#4
0
 public override void NotifyDealResults(DealView completedDeal)
 {
 }
示例#5
0
 public override Card GetPlay(DealView dealInProgress, TrickView trickInProgress)
 {
     return this
         .GetPlayableCards(trickInProgress)
         .Choose();
 }
示例#6
0
 public override Card GetLead(DealView dealInProgress)
 {
     return this
         .GetLeadableCards(dealInProgress)
         .Choose();
 }