diff options
| author | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
| commit | 635d3150e3e85c01b777ff165e21fa8965d58440 (patch) | |
| tree | 3389128f83a5a79f8d0eec0a0e19f54b9d117b66 /dice-lang/src/bjc/dicelang/v1/CompoundDice.java | |
| parent | e59e2a97773f93bdd25bd4680809c10699f0feb3 (diff) | |
Cleanup
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v1/CompoundDice.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v1/CompoundDice.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/dice-lang/src/bjc/dicelang/v1/CompoundDice.java b/dice-lang/src/bjc/dicelang/v1/CompoundDice.java index a70ae39..43d64e8 100644 --- a/dice-lang/src/bjc/dicelang/v1/CompoundDice.java +++ b/dice-lang/src/bjc/dicelang/v1/CompoundDice.java @@ -2,10 +2,10 @@ 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. - * + * * @author ben * */ @@ -22,7 +22,7 @@ public class CompoundDice implements IDiceExpression { /** * Create a new compound dice using the specified dice - * + * * @param lft * The die to use on the left * @param rght @@ -35,7 +35,7 @@ public class CompoundDice implements IDiceExpression { /** * Create a new compound dice from two dice strings - * + * * @param lft * The left side dice as a string * @param rght @@ -47,7 +47,7 @@ public class CompoundDice implements IDiceExpression { /** * Create a new compound dice from an array of dice strings - * + * * @param exps * An array of two dice strings */ @@ -62,10 +62,8 @@ 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"); - } + if(!canOptimize()) 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()); } |
