From 01cb9f504c860bc1c037a44f3a76bf342a293d46 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 22 Mar 2016 12:28:35 -0400 Subject: General formatting cleanup and documentation update --- .../src/main/java/bjc/utils/dice/CompoundDice.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java') 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() + "]"; -- cgit v1.2.3