Position history encaps #52

Merged
rektdie merged 3 commits from positionHistory_encaps into main 2025-04-12 22:23:13 +02:00
Showing only changes of commit a383901bef - Show all commits
+3 -2
View File
@@ -12,7 +12,7 @@
#include "perft.h"
#include "utils.h"
static void ParsePosition(Board &board, std::string_view command) {
static void ParsePosition(Board &board, std::string_view command, SEARCH::SearchContext& ctx) {
if (command.find("startpos") != std::string::npos) {
board.SetByFen(StartingFen);
}
@@ -33,6 +33,7 @@ static void ParsePosition(Board &board, std::string_view command) {
for (std::string_view move : moves) {
bool isLegal = board.MakeMove(UTILS::parseMove(board, move));
ctx.positionHistory[board.positionIndex] = board.hashKey;
}
}
@@ -124,7 +125,7 @@ void UCILoop(Board &board) {
// parse UCI "position" command
if (input.find("position") != std::string::npos) {
ParsePosition(board, input);
ParsePosition(board, input, ctx);
continue;
}