Пример #1
0
 public double GetTargetScore(List <Player> players)
 {
     return(CardCountingRules.TargetScore(
                players
                .SelectMany(x => x.WonHands.Cast <Card>())
                .Count(x => x.IsOudler())));
 }
Пример #2
0
 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();
 }
Пример #3
0
 public bool CanDeclareMisere(Player player)
 {
     return(CardCountingRules.HasMisere(player.Hand.Cast <Card>().Count(x => !x.IsTrumper() && x.Points() > 10)));
 }
Пример #4
0
 public bool CanDeclareHandful(Player player)
 {
     return(CardCountingRules.HasHandful(player.Hand.Cast <Card>().Count(x => x.IsTrumper())));
 }
Пример #5
0
 public static double Score(this IEnumerable <Card> cardsToCount)
 {
     return(cardsToCount.Select(x => CardCountingRules.GetPoints(x.IsTrumper(), x.IsOudler(), x.Points())).Sum());
 }