perfect: Enable PERFECT_AI_SUPPORT only on MSVC
This commit is contained in:
parent
744a0df873
commit
e2f87cb477
|
@ -52,7 +52,7 @@
|
||||||
//#define PVS_AI
|
//#define PVS_AI
|
||||||
#define MTDF_AI
|
#define MTDF_AI
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
#define PERFECT_AI_SUPPORT
|
#define PERFECT_AI_SUPPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,9 @@
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
#include "perfect/perfect.h"
|
#include "perfect/perfect.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEST_MODE
|
#ifdef TEST_MODE
|
||||||
#ifdef QT_GUI_LIB
|
#ifdef QT_GUI_LIB
|
||||||
|
@ -220,9 +222,11 @@ void Test::readFromMemory()
|
||||||
sharedMemory.unlock();
|
sharedMemory.unlock();
|
||||||
readStr = str;
|
readStr = str;
|
||||||
|
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
if (gameOptions.getPerfectAiEnabled()) {
|
if (gameOptions.getPerfectAiEnabled()) {
|
||||||
perfect_command(str.toStdString().c_str());
|
perfect_command(str.toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
emit command(str.toStdString());
|
emit command(str.toStdString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,9 @@
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
|
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
#include "perfect/perfect.h"
|
#include "perfect/perfect.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -230,9 +232,11 @@ void Game::gameReset()
|
||||||
moveHistory.emplace_back(bak);
|
moveHistory.emplace_back(bak);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
if (gameOptions.getPerfectAiEnabled()) {
|
if (gameOptions.getPerfectAiEnabled()) {
|
||||||
perfect_reset();
|
perfect_reset();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
position.reset();
|
position.reset();
|
||||||
elapsedSeconds[BLACK] = elapsedSeconds[WHITE] = 0;
|
elapsedSeconds[BLACK] = elapsedSeconds[WHITE] = 0;
|
||||||
|
@ -596,11 +600,13 @@ void Game::setPerfectAi(bool enabled)
|
||||||
gameOptions.setPerfectAiEnabled(enabled);
|
gameOptions.setPerfectAiEnabled(enabled);
|
||||||
settings->setValue("Options/PerfectAI", enabled);
|
settings->setValue("Options/PerfectAI", enabled);
|
||||||
|
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
perfect_reset();
|
perfect_reset();
|
||||||
} else {
|
} else {
|
||||||
perfect_exit();
|
perfect_exit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::setIDS(bool enabled)
|
void Game::setIDS(bool enabled)
|
||||||
|
@ -918,9 +924,11 @@ bool Game::actionPiece(QPointF p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
if (gameOptions.getPerfectAiEnabled()) {
|
if (gameOptions.getPerfectAiEnabled()) {
|
||||||
perfect_command((char *)position.record);
|
perfect_command((char *)position.record);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
moveHistory.emplace_back(position.record);
|
moveHistory.emplace_back(position.record);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue