| Constructor and Description |
|---|
SimpleDiceRoll() |
SimpleDiceRoll(Function<Integer,Dice> diceFunction) |
| Modifier and Type | Method and Description |
|---|---|
int |
roll(String expression)
Rolls the dices specified by the given expression.
|
public int roll(String expression)
DiceRollA 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.
Copyright © 2017. All rights reserved.