No globals #50
No files matched your search
+3
-5
@@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
namespace SEARCH {
|
namespace SEARCH {
|
||||||
|
|
||||||
U64 nodesToGo = 0;
|
|
||||||
|
|
||||||
static inline int timeToSearch = 0;
|
static inline int timeToSearch = 0;
|
||||||
|
|
||||||
Stopwatch sw;
|
Stopwatch sw;
|
||||||
@@ -147,7 +145,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply, Searc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ctx.nodes > nodesToGo) {
|
if (ctx.nodes > ctx.nodesToGo) {
|
||||||
StopSearch();
|
StopSearch();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -217,7 +215,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply, SearchCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if constexpr (mode == nodesMode) {
|
} else if constexpr (mode == nodesMode) {
|
||||||
if (ctx.nodes > nodesToGo) {
|
if (ctx.nodes > ctx.nodesToGo) {
|
||||||
StopSearch();
|
StopSearch();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -468,7 +466,7 @@ SearchResults SearchPosition(Board &board, SearchParams params, SearchContext& c
|
|||||||
ctx.nodes = 0;
|
ctx.nodes = 0;
|
||||||
|
|
||||||
if constexpr (mode == nodesMode) {
|
if constexpr (mode == nodesMode) {
|
||||||
nodesToGo = params.nodes;
|
ctx.nodesToGo = params.nodes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.pvLine.Clear();
|
ctx.pvLine.Clear();
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ public:
|
|||||||
class SearchContext {
|
class SearchContext {
|
||||||
public:
|
public:
|
||||||
U64 nodes = 0;
|
U64 nodes = 0;
|
||||||
|
U64 nodesToGo = 0;
|
||||||
|
|
||||||
bool doingNullMove = false;
|
bool doingNullMove = false;
|
||||||
PVLine pvLine;
|
PVLine pvLine;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user