/// <summary>
        /// Roll the dices
        /// </summary>
        /// <returns></returns>
        public int Roll()
        {
            var rcr = new RngCryptoRandom(true);

            ResultRoll = Dices.Aggregate(0, (current, c) => current += c.Roll(rcr));

            return(ResultRoll);
        }
        /// <summary>
        /// Roll the dices
        /// </summary>
        /// <returns></returns>
        public string[] Roll()
        {
            var rcr = new RngCryptoRandom(true);

            Result = Dices.Select(c => c.Roll(rcr)).ToArray();

            return(Result);
        }
Exemple #3
0
        /// <summary>
        /// Roll the dice
        /// </summary>
        /// <param name="rcr"></param>
        /// <returns></returns>
        internal int Roll(RngCryptoRandom rcr)
        {
            //ResultRoll = Enumerable.Range(1, _amount).Sum(c => rcr.Next(1, _size + 1));

            DiceRollResult = Enumerable.Range(1, _amount).Select(c => rcr.Next(1, _size + 1)).ToArray();

            return(ResultRoll + _modifier);
        }
        /// <summary>
        /// Roll the dice
        /// </summary>
        /// <param name="rcr"></param>
        /// <returns></returns>
        internal string Roll(RngCryptoRandom rcr)
        {
            Result = _sides[rcr.Next(0, _sides.Count)];

            return(Result);
        }