small refactor in uci

This commit is contained in:
rektdie committed 2025-03-20 20:45:58 +01:00
1 parent 0ffc2c77de
commit 4719508080
2 files changed
+2 -9

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@
#include "perft.h" #include "perft.h"
#include "utils.h" #include "utils.h"
void ParsePosition(Board &board, std::string_view command) { static void ParsePosition(Board &board, std::string_view command) {
if (command.find("startpos") != std::string::npos) { if (command.find("startpos") != std::string::npos) {
board.SetByFen(StartingFen); board.SetByFen(StartingFen);
} }
@@ -58,7 +58,7 @@ static int ReadParam(std::string param, std::string &command) {
return 0; return 0;
} }
void ParseGo(Board &board, std::string &command) { static void ParseGo(Board &board, std::string &command) {
SearchParams params; SearchParams params;
params.wtime = ReadParam("wtime", command); params.wtime = ReadParam("wtime", command);
-7
View File
@@ -13,12 +13,5 @@ public:
SearchParams(){} SearchParams(){}
}; };
// Initializes the position with given parameters
void ParsePosition(Board &board, std::string_view command);
// Parse UCI "go" command
// GUI sends the engine this command if it should start searching for the best move
void ParseGo(Board &board, std::string &command);
// main UCI loop // main UCI loop
void UCILoop(Board &board); void UCILoop(Board &board);