Custom Dice

  • A class that allows for dice with custom sides instead of numbers.

    This class wraps a Die instance, and when roll() is called on this, it calls the Die’s roll() method and maps the output to one of the DieSides passed to the initializer.

    Since

    0.16.0

    Author

    Samasaur
    See more

    Declaration

    Swift

    public struct CustomDie<Output> where Output : Hashable
    extension CustomDie: Equatable
    extension CustomDie: Hashable
    extension CustomDie: Describable
  • A class that masks a side, returning a custom value in lieu of a number.

    Since

    0.16.0

    Author

    Samasaur
    See more

    Declaration

    Swift

    public struct DieSide<OutputType> : Hashable where OutputType : Hashable
    extension DieSide: CustomStringConvertible where OutputType: CustomStringConvertible
    extension DieSide: CustomDebugStringConvertible where OutputType: CustomDebugStringConvertible