예제 #1
0
 public decimal PrizePool()
 {
     if (payoutPool == null)
     {
         payoutPool = Decimal.Parse(Args[0]);
     }
     return(wc.GetPrizePool(winningCombination, payoutPool.Value));
 }
예제 #2
0
        public void SettleDraw(DateTime drawDate, int[] results)
        {
            WinningsCalculator wc = new WinningsCalculator();
            Draw d = _draws[drawDate];

            d.IsOpen = false;
            Dictionary <int, List <Ticket> > ticketCategories = SplitTicketsIntoCategories(results, d);

            for (int i = 0; i <= results.Length; i++)
            {
                decimal prizePool = wc.GetPrizePool(i, d.TotalPoolSize * (1 - OperatorDeductionFactor));
                foreach (Ticket t in ticketCategories[i])
                {
                    t.IsOpen = false;
                    if (prizePool > 0)
                    {
                        decimal totalTicketValue = GetTotalTicketValue(ticketCategories[i]);
                        t.Winnings = t.Value * prizePool / totalTicketValue;
                        _playerManager.AdjustBalance(t.Holder.PlayerId,
                                                     t.Winnings);
                    }
                }
            }
        }
예제 #3
0
 public decimal PrizePool()
 {
     return(wc.GetPrizePool(winningCombination, payoutPool));
 }