点击新建游戏按钮后等待搜索完毕才开始新局

This commit is contained in:
Calcitem 2020-10-31 02:08:53 +08:00
parent d674389cb7
commit a6fab8248a
2 changed files with 8 additions and 5 deletions

View File

@ -112,11 +112,6 @@ void go(Position *pos)
{
#ifdef UCI_AUTO_RESTART
// TODO
#if 0
for (int i = 0; i < 100000; i++) {
}
#endif
while (true) {
if (Threads.main()->searching == true) {
continue;

View File

@ -30,6 +30,7 @@
#include <QPropertyAnimation>
#include <QParallelAnimationGroup>
#include <QDir>
#include <QThread>
#include <iomanip>
#include "gamecontroller.h"
@ -185,6 +186,13 @@ void GameController::gameStart()
void GameController::gameReset()
{
while (aiThread[BLACK]->searching || aiThread[WHITE]->searching) {
loggerDebug(".");
QThread::msleep(100);
}
loggerDebug("\n");
// 停止计时器
if (timeID != 0)
killTimer(timeID);