Пример #1
0
        public IRouletteRolls GenerateRolls(RouletteStyle rouletteStyle, ulong rolls)
        {
            var randomGenerator = new RandomGenerator();

            var rouletteRolls = randomGenerator.GenerateRouletteRolls(rouletteStyle, rolls);

            return(rouletteRolls);
        }
        internal IRouletteRolls GenerateRouletteRolls(RouletteStyle rouletteStyle, ulong rolls)
        {
            int maxValue      = 36;
            var rollUnitsPool = new RollTemplatesPool(maxValue);
            var rouletteRolls = new RouletteRolls(rollUnitsPool);

            using (var dotNetRandom = new TrueRandom())
            {
                for (ulong i = 0; i < rolls; i++)
                {
                    var randomNumber = dotNetRandom.Next(maxValue);
                    rouletteRolls.Add(randomNumber);
                }
            }
            return(rouletteRolls);
        }