D20 class

An expression-capable dice roller.

Simple usage:

  final D20 d20 = D20();
  d20.roll('2d6+3');

See also rollWithStatistics, RollStatistics and RollResult.

Constructors

D20({Random? random})
Creates a dice roller.

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(String roll) int
Compute an arithmetic expression from a roll defined on standard notation format.
rollWithStatistics(String roll) RollStatistics
Compute and return a RollStatistics with all information from a roll, including the result from each individual dice roll within.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited