Rollables
-
A representation of a single die.
It can be rolled using the
roll()method, which will give aRollresult.A
See moreDieobject cannot change. Use the addition operators and theDiceclass to represent more complex dice expressions.Declaration
Swift
public struct Dieextension Die: Rollableextension Die: Equatableextension Die: Comparableextension Die: Hashableextension Die: Describable -
A collection of
Dieobjects and/or a modifier that can be rolled using theroll()method.The properties of
See moreDiceobjects are immutable; use the addition operators to combine them with otherDieobjects or modifiers. You can use compound assignment operators if you want, so long as you declare theDiceobject as avarinstead of aletconstant. -
A representation of a weighted die; i.e. a die whose sides do not necessarily have the same chance of being rolled.
The chances of specific rolls are passed using a
Chancesobject. It is recommended to create the object separately, because it is easier to manipulate theChances that way.See moreSince
0.16.0Declaration
Swift
public struct WeightedDieextension WeightedDie: Rollableextension WeightedDie: Equatableextension WeightedDie: Hashableextension WeightedDie: Describable
View on GitHub
Rollables Reference