diff options
| author | student <student@localhost> | 2018-03-05 16:48:38 -0500 |
|---|---|---|
| committer | student <student@localhost> | 2018-03-05 16:48:38 -0500 |
| commit | 806cba069576e48477d4660a019a49c405cb0195 (patch) | |
| tree | c1e718b18e660c02a12b5a466a222daf8a435bf4 /base/src/bjc/dicelang/eval/DiceEvaluatorResult.java | |
| parent | f9d9bd4bbf7dd6a297e1daf5ee7b4263d706d9cd (diff) | |
Update
Diffstat (limited to 'base/src/bjc/dicelang/eval/DiceEvaluatorResult.java')
| -rw-r--r-- | base/src/bjc/dicelang/eval/DiceEvaluatorResult.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/base/src/bjc/dicelang/eval/DiceEvaluatorResult.java b/base/src/bjc/dicelang/eval/DiceEvaluatorResult.java index 02d01ae..c0e9643 100644 --- a/base/src/bjc/dicelang/eval/DiceEvaluatorResult.java +++ b/base/src/bjc/dicelang/eval/DiceEvaluatorResult.java @@ -6,26 +6,55 @@ import bjc.dicelang.dice.DieList; import bjc.dicelang.dice.ListDiceExpression; import bjc.dicelang.dice.ScalarDiceExpression; +/** + * Represents a result containing a dice value. + * + * @author student + * + */ public class DiceEvaluatorResult extends EvaluatorResult { /** * The dice value of the result. */ public DiceExpression diceVal; + /** + * Create a new result from an expression. + * + * @param expr + * The expression to use. + */ public DiceEvaluatorResult(DiceExpression expr) { super(Type.DICE); diceVal = expr; } + /** + * Create a new result from a die. + * + * @param die + * The die to use. + */ public DiceEvaluatorResult(Die die) { this(new ScalarDiceExpression(die)); } + /** + * Create a new result from a die list. + * + * @param list + * The die list to use. + */ public DiceEvaluatorResult(DieList list) { this(new ListDiceExpression(list)); } + /** + * Check if the result is a list. + * + * @return If the result is a list. + */ public boolean isList() { return diceVal.isList(); } |
