copyWithModifierValue method

Dice copyWithModifierValue(
  1. int statValue
)

Creates a copy of this dice with the modifier value set to the given stat value. The sign is updated using this operation, so use it instead of copyWith if you want to use a stat.

Implementation

Dice copyWithModifierValue(int statValue) => copyWith(
      amount: amount,
      sides: sides,
      modifierValue: statValue,
      modifierSign: !statValue.isNegative ? '+' : '-',
    );