// Method adding prize tier to PrizeTiers property private void AddPrizeTier(PrizeTier prizeTier) { if (prizeTier != null) { PrizeTiers.Add(prizeTier); } }
// Method setting PrizeTiers per Distribution public void SetPrizeTiers(Draw draw) { if (draw == null) { throw new ArgumentNullException("draw", "Draw cannot be null to set prize tiers"); } PrizeTier prizeTier12 = new PrizeTier(PrizeTierCategory.SixOutOfSixWithKinoBonus); prizeTier12.SetMoneyPrize(draw); PrizeTier prizeTier11 = new PrizeTier(PrizeTierCategory.SixOutOfSix); prizeTier11.SetMoneyPrize(draw); PrizeTier prizeTier10 = new PrizeTier(PrizeTierCategory.FiveOutOfSixWithKinoBonus); prizeTier10.SetMoneyPrize(draw); PrizeTier prizeTier9 = new PrizeTier(PrizeTierCategory.FiveOutOfSix); prizeTier9.SetMoneyPrize(draw); PrizeTier prizeTier8 = new PrizeTier(PrizeTierCategory.FourOutOfSixWithKinoBonus); prizeTier8.SetMoneyPrize(draw); PrizeTier prizeTier7 = new PrizeTier(PrizeTierCategory.FourOutOfSix); prizeTier7.SetMoneyPrize(draw); PrizeTier prizeTier6 = new PrizeTier(PrizeTierCategory.ThreeOutOfSixWithKinoBonus); prizeTier6.SetMoneyPrize(draw); PrizeTier prizeTier5 = new PrizeTier(PrizeTierCategory.ThreeOutOfSix); prizeTier5.SetMoneyPrize(draw); PrizeTier prizeTier4 = new PrizeTier(PrizeTierCategory.TwoOutOfSixWithKinoBonus); prizeTier4.SetMoneyPrize(draw); PrizeTier prizeTier3 = new PrizeTier(PrizeTierCategory.TwoOutOfSix); prizeTier3.SetMoneyPrize(draw); PrizeTier prizeTier2 = new PrizeTier(PrizeTierCategory.OneOutOfSixWithKinoBonus); prizeTier2.SetMoneyPrize(draw); PrizeTier prizeTier1 = new PrizeTier(PrizeTierCategory.OneOutOfSix); prizeTier1.SetMoneyPrize(draw); PrizeTier prizeTier0 = new PrizeTier(PrizeTierCategory.ZeroOutOfSix); prizeTier0.SetMoneyPrize(draw); PrizeTiers.Add(prizeTier12); PrizeTiers.Add(prizeTier11); PrizeTiers.Add(prizeTier10); PrizeTiers.Add(prizeTier9); PrizeTiers.Add(prizeTier8); PrizeTiers.Add(prizeTier7); PrizeTiers.Add(prizeTier6); PrizeTiers.Add(prizeTier5); PrizeTiers.Add(prizeTier4); PrizeTiers.Add(prizeTier3); PrizeTiers.Add(prizeTier2); PrizeTiers.Add(prizeTier1); PrizeTiers.Add(prizeTier0); foreach (LotteryTicket ticket in draw.Tickets) { foreach (PrizeTier prizeTier in PrizeTiers) { if (prizeTier.Type == ticket.WinningCategory) { prizeTier.Tickets.Add(ticket); } } } }