Ejemplo n.º 1
0
        public SortingMoneyPerDraw CreateObjectSortingMoneyPerDraw()
        {
            SortingMoneyPerDraw sortingMoneyPerDraw = new SortingMoneyPerDraw()
            {
                Charity = 0,
                listMoneyPerCategory = new List <double>(),
                JackPot = 0
            };

            return(sortingMoneyPerDraw);
        }
Ejemplo n.º 2
0
        public double SortingByDraw(List <WinningColumnPerKinoTicket> listResultPerDrawPerKinoTicket, double initialAmount, NumbersOfDraw numbersOfDraw)
        {
            SortingMoneyPerDraw sortingMoneyPerDraw = new SortingMoneyPerDraw();
            List <Result>       listObjectOfProfitPerTicket = new List <Result>();
            int c1_KB = 0, c2_KB = 0, c3_KB = 0, c4_KB = 0, c5_KB = 0, c6_KB = 0, c7_KB = 0, c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0, c7 = 0;

            foreach (WinningColumnPerKinoTicket winningNumbersPerKinoTicketsPerDraw in listResultPerDrawPerKinoTicket)
            {
                var category = CreateResulutPerDraw();
                if (winningNumbersPerKinoTicketsPerDraw.FoundKinoBonus)
                {
                    switch (winningNumbersPerKinoTicketsPerDraw.ListWinningsNumbers.Count)
                    {
                    case (int)Category.firstCategory:
                        c1_KB           += 1;
                        category.Percent = firstCategoryWithKB;
                        break;

                    case (int)Category.secondCategory:
                        c2_KB           += 1;
                        category.Percent = secondCategoryWithKB;
                        break;

                    case (int)Category.thirdCategory:
                        c3_KB           += 1;
                        category.Percent = thirdCategoryWithKB;
                        break;

                    case (int)Category.fourthCategory:
                        c4_KB           += 1;
                        category.Percent = fourthCategoryWithKB;
                        break;

                    case (int)Category.fifthCategory:
                        c5_KB           += 1;
                        category.Percent = fifthCategoryWithKB;
                        break;

                    case (int)Category.sixthCategory:
                        c6_KB           += 1;
                        category.Percent = sixthCategoryWithKB;
                        break;

                    case (int)Category.seventhCategory:
                        c7_KB += 1;
                        break;
                    }
                }
                else
                {
                    switch (winningNumbersPerKinoTicketsPerDraw.ListWinningsNumbers.Count)
                    {
                    case (int)Category.firstCategory:
                        c1 += 1;
                        category.Percent = firstCategory;
                        break;

                    case (int)Category.secondCategory:
                        c2 += 1;
                        category.Percent = secondCategory;
                        break;

                    case (int)Category.thirdCategory:
                        c3 += 1;
                        category.Percent = thirdCategory;
                        break;

                    case (int)Category.fourthCategory:
                        c4 += 1;
                        category.Percent = fourthCategory;
                        break;

                    case (int)Category.fifthCategory:
                        c5 += 1;
                        category.Percent = fifthCategory;
                        break;

                    case (int)Category.sixthCategory:
                        c6 += 1;
                        category.Percent = sixthCategory;
                        break;

                    case (int)Category.seventhCategory:
                        c7 += 1;
                        break;
                    }
                }
                listObjectOfProfitPerTicket.Add(category);
            }
            double jackPot = sortingMoneyPerDraw.PrintReSult(c1_KB, c2_KB, c3_KB, c4_KB, c5_KB, c6_KB, c7_KB, c1, c2, c3, c4, c5, c6, c7, initialAmount, numbersOfDraw);

            return(jackPot);
        }
Ejemplo n.º 3
0
        public double CalculationProfitPerPlayer(int counter, double percentCategory, double initialAmount, SortingMoneyPerDraw sortingMoneyPerDraw)// Μέθοδος υπολογισμού κέρδους ανα κατηγορία ανα παίχτη
        {
            double profitPerPlayer;

            if (counter != 0)
            {
                double drawAmount = CalculationPercentPerCategory(initialAmountPerCent) * initialAmount;         // Υπολογισμός χρημάτων που θα μοιραστούν επι το 93% του αρχικού ποσού
                double calculationAmountPerCategory = CalculationProfitPerCategory(percentCategory, drawAmount); // Υπολογισμός χρημάτων ανα κατηγορία βάση το 93%
                profitPerPlayer = calculationAmountPerCategory / counter;                                        // Υπολογισμός χρημάτων ανα κατηγορία ανα παίχτη βάση το 93%
                sortingMoneyPerDraw.listMoneyPerCategory.Add(calculationAmountPerCategory);
            }
            else
            {
                profitPerPlayer = 0;
            }
            return(profitPerPlayer);
        }