encapsulated TT

This commit is contained in:
rektdie committed 2025-04-11 22:28:16 +02:00
1 parent e7079c3c73
commit 8ca878275a
6 files changed
+28 -26

No files matched your search

+4 -4
View File
@@ -92,10 +92,10 @@ static void ParseGo(Board &board, std::string &command, SEARCH::SearchContext& c
}
}
static void SetOption(std::string &command) {
static void SetOption(std::string &command, SEARCH::SearchContext& ctx) {
if (command.find("Hash") != std::string::npos) {
hashSize = (ReadParam("value", command) * 1000000) / sizeof(TTEntry);
TT.Resize(hashSize);
ctx.TT->Resize(hashSize);
}
}
@@ -134,7 +134,7 @@ void UCILoop(Board &board) {
board.SetByFen(StartingFen);
// Clearing
TT.Clear();
ctx.TT->Clear();
ctx.killerMoves = {};
ctx.history.Clear();
@@ -169,7 +169,7 @@ void UCILoop(Board &board) {
}
if (input.find("setoption") != std::string::npos) {
SetOption(input);
SetOption(input, ctx);
continue;
}