예제 #1
0
 public static int eval(this Game o, Draw d, GameType gt, PrizeCategory pc)
 {
     if(gt == GameType.Undefined || pc == PrizeCategory.Undefined)
         return 0;
     o.notNull(); d.notNull();
     return o.Playslips.Sum(playslip => eval((Playslip)playslip, d, gt, pc));
 }
예제 #2
0
 public EvaluationDto(Game game, Draw draw)
 {
     this.game = game.notNull();
     this.draw = draw.notNull();
     IsWin = game.win(draw);
     IsWin_L649 = game.Playslips.Any(x => x.win(draw, GameType.Lotto649));
     IsWin_S77 = game.Playslips.Any(x => x.win(draw, GameType.Spiel77));
     IsWin_S6 = game.Playslips.Any(x => x.win(draw, GameType.Super6));
 }
예제 #3
0
 public static int eval(this Board o, Draw d, PrizeCategory pc)
 {
     if(pc == PrizeCategory.Undefined)
         return 0;
     o.notNull();
     d.notNull();
     var intersect = o.AsArray.Intersect(d.Lotto).Count();
     return EvalUtil.hits(intersect, o.AsArray.Contains(d.Zz), o.Playslip.Sz == d.Sz, pc, o.Combo);
 }
예제 #4
0
 public DrawDto(Draw draw)
 {
     draw.notNull();
     Super6 = draw.S6String;
     Spiel77 = draw.S77String;
     Lotto = draw.LString;
     Superzahl = draw.Sz.ToString();
     Zusatzzahl = draw.Zz.ToString();
 }
예제 #5
0
 public static int eval(this Playslip o, Draw d, GameType gt, PrizeCategory pc)
 {
     if(gt == GameType.Undefined || pc == PrizeCategory.Undefined)
         return 0;
     o.notNull(); d.notNull();
     switch(gt) {
         case (GameType.Lotto649):
             if(pc <= PrizeCategory.VIII)
                 return o.Boards.Sum(board => board.eval(d, pc));
             break;
         case (GameType.Spiel77):
             if(o.IsS77 && pc <= PrizeCategory.VII)
                 return EvalUtil.hits(gt, pc, o.Nr.AsSpiel77.rightToLeft(d.Spiel77));
             break;
         case (GameType.Super6):
             if(o.IsS6 && pc <= PrizeCategory.VI)
                 return EvalUtil.hits(gt, pc, o.Nr.AsSuper6.rightToLeft(d.Super6));
             break;
     }
     return 0;
 }
예제 #6
0
 public static bool win(this Playslip o, Draw d, GameType gt)
 {
     o.notNull(); d.notNull();
     if(o.valid()) {
         switch(gt) {
             case (GameType.Lotto649):
                 return o.Boards.Any(tipp => tipp.win(d));
             case (GameType.Spiel77):
                 return o.IsS77 && o.Nr.AsSpiel77.Last().Equals(d.Spiel77.Last());
             case (GameType.Super6):
                 return o.IsS6 && o.Nr.AsSuper6.Last().Equals(d.Super6.Last());
         }
     }
     return false;
 }
예제 #7
0
 public static bool win(this Game o, Draw d)
 {
     o.notNull(); d.notNull();
     return o.valid() && o.Playslips.Any(x => x.win(d));
 }
예제 #8
0
 public static bool win(this Board o, Draw d)
 {
     o.notNull(); d.notNull();
     return o.valid() &&
            2 < o.AsArray.Intersect(d.Lotto).Count();
 }
예제 #9
0
 public static bool win(this Playslip o, Draw d)
 {
     o.notNull(); d.notNull();
     return o.valid() &&
            (o.win(d, GameType.Lotto649) ||
             o.win(d, GameType.Spiel77) ||
             o.win(d, GameType.Super6));
 }