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); }
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(); }
public override void NotifyDealResults(DealView completedDeal) { }
public override Card GetPlay(DealView dealInProgress, TrickView trickInProgress) { return this .GetPlayableCards(trickInProgress) .Choose(); }
public override Card GetLead(DealView dealInProgress) { return this .GetLeadableCards(dealInProgress) .Choose(); }