-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TransPosTableEntry.java
81 lines (68 loc) · 1.37 KB
/
TransPosTableEntry.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
75
76
77
78
79
80
81
import java.io.Serializable;
//Info for board entry, could store the board, need to store depth, need evaluation...
public class TransPosTableEntry implements Serializable, Comparable<TransPosTableEntry>
{
private static final long serialVersionUID = 1L;
private Board board;
private int eval;
private int depth;
private int winCount;
private int lossCount;
private int color;
public int compareTo(TransPosTableEntry newEntry)
{
if(this.eval <= newEntry.eval)
return 1;
else
return 0;
}
public TransPosTableEntry(Board board,int eval, int depth, int color)
{
this.board = board;
this.eval = eval;
this.depth = depth;
this.color = color;
}
public TransPosTableEntry(TransPosTableEntry temp)
{
this.board = new Board(temp.board);
this.eval = new Integer(temp.eval);
this.depth = new Integer(temp.depth);
}
public Board getBoard()
{
return board;
}
public int getColor()
{
return color;
}
public int getEval()
{
return eval;
}
public int getDepth()
{
return depth;
}
public void updateEval(int eval)
{
this.eval = eval;
}
public void incrementWinCount()
{
winCount++;
}
public void incrementLossCount()
{
lossCount++;
}
public int getWinCount()
{
return winCount;
}
public int getLossCount()
{
return lossCount;
}
}