diff options
Diffstat (limited to 'dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java')
| -rw-r--r-- | dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java b/dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java new file mode 100644 index 0000000..5090bc7 --- /dev/null +++ b/dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java @@ -0,0 +1,40 @@ +package bjc.dicelang.neodice.statements; + +import java.util.*; + +public abstract class StatementValue { + public static enum Type { + VOID, + BOOLEAN, + INTEGER, + + INT_ARRAY, + + DIE, + DIEPOOL, + + ARRAY, + } + + public final Type type; + + protected StatementValue(Type type) { + this.type = type; + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (getClass() != obj.getClass()) return false; + + StatementValue other = (StatementValue) obj; + + return type == other.type; + } +}
\ No newline at end of file |
