void go(Position& pos, istringstream& is) {
string token;
+ Search::LimitsType limits;
+ std::vector<Move> searchMoves;
int time[] = { 0, 0 }, inc[] = { 0, 0 };
- memset(&Search::Limits, 0, sizeof(Search::Limits));
- Search::RootMoves.clear();
- Search::RootPosition = &pos;
-
while (is >> token)
{
if (token == "infinite")
- Search::Limits.infinite = true;
+ limits.infinite = true;
else if (token == "ponder")
- Search::Limits.ponder = true;
+ limits.ponder = true;
else if (token == "wtime")
is >> time[WHITE];
else if (token == "btime")
else if (token == "binc")
is >> inc[BLACK];
else if (token == "movestogo")
- is >> Search::Limits.movesToGo;
+ is >> limits.movesToGo;
else if (token == "depth")
- is >> Search::Limits.maxDepth;
+ is >> limits.maxDepth;
else if (token == "nodes")
- is >> Search::Limits.maxNodes;
+ is >> limits.maxNodes;
else if (token == "movetime")
- is >> Search::Limits.maxTime;
+ is >> limits.maxTime;
else if (token == "searchmoves")
while (is >> token)
- Search::RootMoves.push_back(move_from_uci(pos, token));
+ searchMoves.push_back(move_from_uci(pos, token));
}
+ searchMoves.push_back(MOVE_NONE);
+ limits.time = time[pos.side_to_move()];
+ limits.increment = inc[pos.side_to_move()];
- Search::RootMoves.push_back(MOVE_NONE);
- Search::Limits.time = time[pos.side_to_move()];
- Search::Limits.increment = inc[pos.side_to_move()];
-
- Threads.start_thinking();
+ Threads.start_thinking(pos, limits, searchMoves, true);
}