perfect: Enable PERFECT_AI_SUPPORT only on MSVC

This commit is contained in:
Calcitem 2021-01-24 14:16:41 +08:00
parent 744a0df873
commit e2f87cb477
3 changed files with 13 additions and 1 deletions

View File

@ -52,7 +52,7 @@
//#define PVS_AI
#define MTDF_AI
#ifdef WIN32
#ifdef _MSC_VER
#define PERFECT_AI_SUPPORT
#endif

View File

@ -31,7 +31,9 @@
#include "option.h"
#include "test.h"
#ifdef PERFECT_AI_SUPPORT
#include "perfect/perfect.h"
#endif
#ifdef TEST_MODE
#ifdef QT_GUI_LIB
@ -220,9 +222,11 @@ void Test::readFromMemory()
sharedMemory.unlock();
readStr = str;
#ifdef PERFECT_AI_SUPPORT
if (gameOptions.getPerfectAiEnabled()) {
perfect_command(str.toStdString().c_str());
}
#endif
emit command(str.toStdString());
}

View File

@ -40,7 +40,9 @@
#include "client.h"
#include "option.h"
#ifdef PERFECT_AI_SUPPORT
#include "perfect/perfect.h"
#endif
using namespace std;
@ -230,9 +232,11 @@ void Game::gameReset()
moveHistory.emplace_back(bak);
}
#ifdef PERFECT_AI_SUPPORT
if (gameOptions.getPerfectAiEnabled()) {
perfect_reset();
}
#endif
position.reset();
elapsedSeconds[BLACK] = elapsedSeconds[WHITE] = 0;
@ -596,11 +600,13 @@ void Game::setPerfectAi(bool enabled)
gameOptions.setPerfectAiEnabled(enabled);
settings->setValue("Options/PerfectAI", enabled);
#ifdef PERFECT_AI_SUPPORT
if (enabled) {
perfect_reset();
} else {
perfect_exit();
}
#endif
}
void Game::setIDS(bool enabled)
@ -918,9 +924,11 @@ bool Game::actionPiece(QPointF p)
}
if (result) {
#ifdef PERFECT_AI_SUPPORT
if (gameOptions.getPerfectAiEnabled()) {
perfect_command((char *)position.record);
}
#endif
moveHistory.emplace_back(position.record);