Esempio n. 1
0
 public override Card GetLead(DealView dealInProgress)
 {
     // who cares, just lead whatever
     return this
         .GetLeadableCards(dealInProgress)
         .Choose();
 }
Esempio n. 2
0
 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);
 }
Esempio n. 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();
 }
Esempio n. 4
0
 public override void NotifyDealResults(DealView completedDeal)
 {
 }
Esempio n. 5
0
 public override Card GetPlay(DealView dealInProgress, TrickView trickInProgress)
 {
     return this
         .GetPlayableCards(trickInProgress)
         .Choose();
 }
Esempio n. 6
0
 public override Card GetLead(DealView dealInProgress)
 {
     return this
         .GetLeadableCards(dealInProgress)
         .Choose();
 }