-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsearchinfo.cpp
executable file
·59 lines (46 loc) · 1016 Bytes
/
searchinfo.cpp
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
#include "searchinfo.h"
#include <cstring>
#include <iostream>
namespace Napoleon
{
SearchInfo::SearchInfo(int time, int maxDepth, int nodes) :maxDepth(maxDepth), nodes(nodes)
{
MaxPly = 0;
allocatedTime = time;
SetDepthLimit(100);
}
int SearchInfo::IncrementDepth()
{
return maxDepth++;
}
int SearchInfo::MaxDepth()
{
return maxDepth;
}
void SearchInfo::SetDepthLimit(int depth)
{
depthLimit = depth;
}
void SearchInfo::NewSearch(int time)
{
ResetNodes();
allocatedTime = time;
maxDepth = 1;
std::memset(history, 0, sizeof(history));
std::memset(killers, 0, sizeof(killers));
timer.Restart();
}
void SearchInfo::StopSearch()
{
SetDepthLimit(100);
}
void SearchInfo::ResetNodes()
{
nodes = 0;
}
void SearchInfo::SetGameTime(int time)
{
allocatedTime = time;
timer.Restart();
}
}