diff options
| author | EVE <EVE@EVE-PC> | 2017-03-13 16:41:45 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-13 16:41:45 -0400 |
| commit | 01136c6796e21f023713e026674576d8e623462d (patch) | |
| tree | e77886fe0e0adaf3c0430fba9ce248ef83f74fe4 /dice-lang/src/bjc/dicelang/v1/CompoundDice.java | |
| parent | 870d769cfc152171d27b2331a7c590d0b307ad48 (diff) | |
Formatting
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v1/CompoundDice.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v1/CompoundDice.java | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/dice-lang/src/bjc/dicelang/v1/CompoundDice.java b/dice-lang/src/bjc/dicelang/v1/CompoundDice.java index 2d53540..a70ae39 100644 --- a/dice-lang/src/bjc/dicelang/v1/CompoundDice.java +++ b/dice-lang/src/bjc/dicelang/v1/CompoundDice.java @@ -3,8 +3,8 @@ package bjc.dicelang.v1; /** * Implements a "compound dice" * - * To explain, a compound dice is something like a d100 composed from two - * d10s instead of a hundred sided die. + * To explain, a compound dice is something like a d100 composed from two d10s + * instead of a hundred sided die. * * @author ben * @@ -13,20 +13,20 @@ public class CompoundDice implements IDiceExpression { /* * The left die of the expression */ - private IDiceExpression left; + private IDiceExpression left; /* * The right die of the expression */ - private IDiceExpression right; + private IDiceExpression right; /** * Create a new compound dice using the specified dice * * @param lft - * The die to use on the left + * The die to use on the left * @param rght - * The die to use on the right + * The die to use on the right */ public CompoundDice(IDiceExpression lft, IDiceExpression rght) { this.left = lft; @@ -37,20 +37,19 @@ public class CompoundDice implements IDiceExpression { * Create a new compound dice from two dice strings * * @param lft - * The left side dice as a string + * The left side dice as a string * @param rght - * The right side dice as a string + * The right side dice as a string */ public CompoundDice(String lft, String rght) { - this(ComplexDice.fromString(lft), - ComplexDice.fromString(rght)); + this(ComplexDice.fromString(lft), ComplexDice.fromString(rght)); } /** * Create a new compound dice from an array of dice strings * * @param exps - * An array of two dice strings + * An array of two dice strings */ public CompoundDice(String[] exps) { this(exps[0], exps[1]); @@ -64,14 +63,11 @@ public class CompoundDice implements IDiceExpression { @Override public int optimize() { if (!canOptimize()) { - throw new UnsupportedOperationException( - "Cannot optimize this compound dice. " - + "Both component dice must be optimizable" - + " to optimize a compound dice"); + throw new UnsupportedOperationException("Cannot optimize this compound dice. " + + "Both component dice must be optimizable" + " to optimize a compound dice"); } - return Integer - .parseInt(left.optimize() + "" + right.optimize()); + return Integer.parseInt(left.optimize() + "" + right.optimize()); } @Override @@ -84,7 +80,6 @@ public class CompoundDice implements IDiceExpression { @Override public String toString() { - return "compound[l=" + left.toString() + ", r=" - + right.toString() + "]"; + return "compound[l=" + left.toString() + ", r=" + right.toString() + "]"; } } |
