diff options
| author | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-03-01 10:13:41 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-03-01 10:13:41 -0500 |
| commit | 36e0911c6ec27707a74f0b90b1052a16374243ea (patch) | |
| tree | 08ca7723b0c0a6a7f3ce1830c59e5211e46168b8 /dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java | |
| parent | 6ed83507953322c35a456d64d89f8f4f9cb0a6a1 (diff) | |
Package reorganization
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java b/dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java deleted file mode 100644 index bac4d2d..0000000 --- a/dice-lang/src/bjc/dicelang/v2/EvaluatorResult.java +++ /dev/null @@ -1,97 +0,0 @@ -package bjc.dicelang.v2;
-
-import bjc.dicelang.v2.dice.Die;
-import bjc.dicelang.v2.dice.DieExpression;
-import bjc.dicelang.v2.dice.DieList;
-import bjc.utils.data.ITree;
-import bjc.utils.data.Tree;
-
-public class EvaluatorResult {
- public static enum Type {
- FAILURE,
- INT, FLOAT, DICE, STRING
- }
-
- public final EvaluatorResult.Type type;
-
- // These may or may not have values based
- // off of the result type
- public long intVal;
- public double floatVal;
- public DieExpression diceVal;
- public String stringVal;
-
- // Original node data
- public ITree<Node> origVal;
-
- public EvaluatorResult(EvaluatorResult.Type typ) {
- type = typ;
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, ITree<Node> orig) {
- this(typ);
-
- origVal = orig;
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, Node orig) {
- this(typ, new Tree<>(orig));
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, EvaluatorResult orig) {
- this(typ, new Node(Node.Type.RESULT, orig));
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, long iVal) {
- this(typ);
-
- intVal = iVal;
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, double dVal) {
- this(typ);
-
- floatVal = dVal;
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, DieExpression dVal) {
- this(typ);
-
- diceVal = dVal;
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, Die dVal) {
- this(typ);
-
- diceVal = new DieExpression(dVal);
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, DieList dVal) {
- this(typ);
-
- diceVal = new DieExpression(dVal);
- }
-
- public EvaluatorResult(EvaluatorResult.Type typ, String strang) {
- this(typ);
-
- stringVal = strang;
- }
-
- public String toString() {
- switch(type) {
- case INT:
- return type.toString() + "(" + intVal + ")";
- case FLOAT:
- return type.toString() + "(" + floatVal + ")";
- case DICE:
- return type.toString() + "(" + diceVal + ")";
- case STRING:
- return type.toString() + "(" + stringVal + ")";
- case FAILURE:
- return type.toString();
- default:
- return "Unknown result type " + type.toString();
- }
- }
-}
\ No newline at end of file |
