-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathState.java
74 lines (60 loc) · 1.2 KB
/
State.java
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
public class State{
private int utility;
private State parent;
private char iden;
private HexBoard board;
private int depth;
private Index move;
public State(){
this.utility = 0;
this.parent = null;
this.iden = 0;
this.board = null;
this.depth = 0;
this.move = null;
}
public State(int u, State p, char i, HexBoard b, Index m){
this.utility = u;
this.parent = p;
this.iden = i;
this.board = b;
this.depth = (this.parent == null)? 0 : this.parent.depth+1;
this.move = m;
}
public int getUtility(){
return this.utility;
}
public char getIden(){
return this.iden;
}
public int getDepth(){
return this.depth;
}
public State getParent(){
return this.parent;
}
public Index getMove(){
return this.move;
}
public HexBoard getBoard(){
return this.board;
}
public void setUtility(int u){
this.utility = u;
}
public void setIden(char i){
this.iden = i;
}
public void setDepth(int d){
this.depth = d;
}
public void setParent(State p){
this.parent = p;
}
public void setMove(Index move){
this.move = move;
}
public void setBoard(HexBoard board){
this.board = board;
}
}