Dice class
This class simulates a pair of dice
Constructors
- Dice({required Die firstDie, required Die secondDie})
- constructor
- Dice.generic()
-
Constructor with default values
factory
Properties
- currentRoll → RollResult?
-
return the most recent roll
no setter
- firstDie → Die
-
first die of the pair
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- previousRoll → RollResult?
-
return the previous roll
no setter
- rollCount → int
-
How many times have these dice been rolled
no setter
-
rolls
→ List<
RollResult> -
history of the rolls for these dice
read-only
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondDie → Die
-
second die of the pair
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
roll(
{int manual1 = -1, int manual2 = -1}) → RollResult - roll the dice randomly if you don't supply values manually/exxplicitly when you do provide values
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited