public interface DiceRoll
A dice roll may use a set of different dices and also has a fixed increment to the total value.
| Modifier and Type | Method and Description |
|---|---|
int |
roll(String expression)
Rolls the dices specified by the given expression.
|
int roll(String expression)
A dice roll is represented by the following expression:
nds (+ nds)* (+ v)?
Where 'n' is the number of dices (optional in case of '1'), 's' is the number of sides and 'v' is a static increment to the final value.
Example: 2d4 + d8 + 3 will roll 2 dices of 4 sides, one dice of 8 sides and add 3 to the final score.
expression - the expression that defines the rollCopyright © 2017. All rights reserved.