Custom Dice
-
A class that allows for dice with custom sides instead of numbers.
This class wraps a
Die
instance, and whenroll()
is called on this, it calls the Die’sroll()
method and maps the output to one of theDieSide
s passed to the initializer.Since
0.16.0Declaration
Swift
public struct CustomDie<Output> where Output : Hashable
extension CustomDie: Equatable
extension CustomDie: Hashable
extension CustomDie: Describable
-
Declaration
Swift
public struct DieSide<OutputType> : Hashable where OutputType : Hashable
extension DieSide: CustomStringConvertible where OutputType: CustomStringConvertible
extension DieSide: CustomDebugStringConvertible where OutputType: CustomDebugStringConvertible