diff options
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java b/BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java index 4e2e9f3..3393711 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java +++ b/BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java @@ -14,6 +14,7 @@ public class CompoundDice implements IDiceExpression { * The left die of the expression */ private IDiceExpression l; + /** * The right die of the expression */ @@ -32,14 +33,33 @@ public class CompoundDice implements IDiceExpression { this.r = r; } + /** + * Create a new compound dice from two dice strings + * + * @param l + * The left side dice + * @param r + * The right side dice + */ public CompoundDice(String l, String r) { this(ComplexDice.fromString(l), ComplexDice.fromString(r)); } + /** + * Create a new compound dice from an array of dice strings + * + * @param exps + * An array of dice strings + */ public CompoundDice(String[] exps) { this(exps[0], exps[1]); } + /* + * (non-Javadoc) + * + * @see bjc.utils.dice.IDiceExpression#roll() + */ @Override public int roll() { /* @@ -48,6 +68,11 @@ public class CompoundDice implements IDiceExpression { return Integer.parseInt(l.roll() + "" + r.roll()); } + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ @Override public String toString() { return "compound[l=" + l.toString() + ", r=" + r.toString() + "]"; |
