Пример #1
0
        /// <summary>
        /// Rolls the request and returns the results.
        /// </summary>
        /// <returns>A <see cref="List{RollResult}" /> containing the results of the roll."</returns>
        public List <RollResult> Roll()
        {
            // Perform actual dice roll.
            List <RollResult> results = RollRequest.Roll(this.count, this.sides, this.negative);

            // Apply filters in-place
            RollRequest.ApplyFilters(results, this.filterType, this.filterValue);

            return(results);
        }
Пример #2
0
        /// <summary>
        /// Add a request to the builder.
        /// </summary>
        /// <param name="sign">Determines if the set is reducing overall value of the roll.</param>
        /// <param name="count">Number of dice to roll.</param>
        /// <param name="sides">Number of sides the dice have.</param>
        /// <param name="filterType">Filter to apply to the results.</param>
        /// <param name="filterValue">Filter value to use for the filter.</param>
        /// <returns>A <see cref="RollRequest" /> containing the requested set of rolls.</returns>
        public RollRequest AddRequest(int sign, int count, int sides, FilterType filterType, int filterValue)
        {
            RollRequest request = new RollRequest(count, sides, filterType, filterValue);

            if (sign < 0)
            {
                request.IsNeg();
            }

            this.requests.Add(request);
            return(request);
        }