public double GetTargetScore(List <Player> players) { return(CardCountingRules.TargetScore( players .SelectMany(x => x.WonHands.Cast <Card>()) .Count(x => x.IsOudler()))); }
public Card(string color, int points) { Color = (CardColors)Enum.Parse(typeof(CardColors), color, true); _faceValue = new FaceValue(points); _isOudler = CheckOudler(); _isFirst = false; _cardScore = CardCountingRules.GetPoints(IsTrumper(), _isOudler, _faceValue.GetPoints()); CheckConsistency(); }
public bool CanDeclareMisere(Player player) { return(CardCountingRules.HasMisere(player.Hand.Cast <Card>().Count(x => !x.IsTrumper() && x.Points() > 10))); }
public bool CanDeclareHandful(Player player) { return(CardCountingRules.HasHandful(player.Hand.Cast <Card>().Count(x => x.IsTrumper()))); }
public static double Score(this IEnumerable <Card> cardsToCount) { return(cardsToCount.Select(x => CardCountingRules.GetPoints(x.IsTrumper(), x.IsOudler(), x.Points())).Sum()); }