summaryrefslogtreecommitdiff
path: root/dice/src/example/java/bjc/dicelang/neodice/statements/StatementValue.java
blob: 5090bc7bcac3182f7bbfac0cb036ad8cd5ffde58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;
	}
}