CapRaffle.Domain.Raffle.StandardRules.ReduceChanceOfWinningByPercentForEachPreviousWin C# (CSharp) Method

ReduceChanceOfWinningByPercentForEachPreviousWin() public method

public ReduceChanceOfWinningByPercentForEachPreviousWin ( List userRaffleTicketsList, int percent ) : void
userRaffleTicketsList List
percent int
return void
        public void ReduceChanceOfWinningByPercentForEachPreviousWin(List<UserTickets> userRaffleTicketsList, int percent)
        {
            foreach (UserTickets urt in userRaffleTicketsList)
            {
                int previousWins = PreviousWinsInCategoryByUser(urt.Email);
                for(int i = 0; i < previousWins; i++)
                {
                    int currentNumberOfTickets = urt.NumberOfTickets;
                    int newNumberOfTickets = currentNumberOfTickets - ((currentNumberOfTickets * percent) / 100);
                    urt.NumberOfTickets = newNumberOfTickets;
                }
            }
        }