Custom Dice
-
A class that allows for dice with custom sides instead of numbers.
This class wraps a
Dieinstance, and whenroll()is called on this, it calls the Die’sroll()method and maps the output to one of theDieSides passed to the initializer.See moreSince
0.16.0Declaration
Swift
public struct CustomDie<Output> where Output : Hashableextension CustomDie: Equatableextension CustomDie: Hashableextension CustomDie: Describable -
Declaration
Swift
public struct DieSide<OutputType> : Hashable where OutputType : Hashableextension DieSide: CustomStringConvertible where OutputType: CustomStringConvertibleextension DieSide: CustomDebugStringConvertible where OutputType: CustomDebugStringConvertible
View on GitHub
Custom Dice Reference