diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-03-28 08:47:45 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-03-28 08:47:45 -0400 |
| commit | 260cc55c485980cd31193300962a88f1de8d62f7 (patch) | |
| tree | c08c646056d04352e18bb80e07b9a35765c8946f /BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java | |
| parent | 4d904a55a1b5fe6506f81c2c292c07dfe839029f (diff) | |
Moved dice things to seperate project
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 | 80 |
1 files changed, 0 insertions, 80 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 deleted file mode 100644 index 3393711..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/CompoundDice.java +++ /dev/null @@ -1,80 +0,0 @@ -package bjc.utils.dice; - -/** - * Implements a "compound dice" - * - * To explain, a compound dice is something like a d100 composed from two - * d10s instead of a hundred sided die. - * - * @author ben - * - */ -public class CompoundDice implements IDiceExpression { - /** - * The left die of the expression - */ - private IDiceExpression l; - - /** - * The right die of the expression - */ - private IDiceExpression r; - - /** - * Create a new compound dice using the specified dice - * - * @param l - * The die to use on the left - * @param r - * The die to use on the right - */ - public CompoundDice(IDiceExpression l, IDiceExpression r) { - this.l = l; - 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() { - /* - * Make the combination of the two dice - */ - 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() + "]"; - } -} |
