MultipleRollResult

public enum MultipleRollResult

An enum representing the type of result to return from rolling multiple times.

  • sum: Return the sum of all rolls.
  • highest: Return the highest roll.
  • lowest: Return the lowest roll.
  • outsides: Return the sum of the highest and the lowest roll.
  • dropHighest: Return the sum of everything but the highest roll.
  • dropLowest: Return the sum of everything except the lowest roll.
  • dropOutsides: Return the sum of everything except the highest and lowest rolls.
  • dropLow: Return the sum of everything except the given number of lowest rolls.
  • dropHigh: Return the sum of everything except the given number of highest rolls.

Since

0.5.0

  • sum

    Return the sum of all rolls.

    Declaration

    Swift

    case sum
  • Return the highest roll.

    Declaration

    Swift

    case highest
  • Return the lowest roll.

    Declaration

    Swift

    case lowest
  • Return the sum of the highest and the lowest roll.

    Declaration

    Swift

    case outsides
  • Return the sum of everything but the highest roll.

    Declaration

    Swift

    case dropHighest
  • Return the sum of everything except the lowest roll. This is used in Pathfinder character generation.

    Declaration

    Swift

    case dropLowest
  • Return the sum of everything except the highest and lowest rolls.

    Declaration

    Swift

    case dropOutsides
  • Return the sum of everything except the given number of lowest rolls.

    This removes the given number of rolls from the low end of the list, and then returns the sum of the remaining rolls. If amountToDrop is 0, it acts like sum; if it’s 1, it acts like dropLowest.

    For example, if the rolls were 2, 8, 6, 4, and 10, and amountToDrop is 3, then the result would be 24 (10 + 8 + 6)

    Declaration

    Swift

    case dropLow(amountToDrop: Int)

    Parameters

    amountToDrop

    The amount to drop from the low end of the rolls.

  • Return the sum of everything except the given number of highest rolls.

    This removes the given number of rolls from the high end of the list, and then returns the sum of the remaining rolls. If amountToDrop is 0, it acts like sum; if it’s 1, it acts like dropHighest.

    For example, if the rolls were 2, 8, 6, 4, and 10, and amountToDrop is 3, then the result would be 12 (2 + 4 + 6)

    Declaration

    Swift

    case dropHigh(amountToDrop: Int)

    Parameters

    amountToDrop

    The amount to drop from the high end of the rolls.