DiceRoller class
A dice roller for M dice of N sides (e.g. 2d6
).
A roll returns a list of ints
Also handles fudge die, and exploding die.
Constructors
- DiceRoller([Random? r])
- Constructs a dice roller (Random can be injected)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
roll(
int ndice, int nsides) → UnmodifiableListView< int> - Roll ndice of nsides and return results as list.
-
rollFudge(
int ndice) → UnmodifiableListView< int> - Roll N fudge dice, return results
-
rollWithExplode(
{required int ndice, required int nsides, bool explode = false, int explodeLimit = defaultExplodeLimit}) → UnmodifiableListView< int> - return result of rolling given number of nsided dice.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited