diff --git a/src/ai/movegen.cpp b/src/ai/movegen.cpp index c6685e67..1c5a0bb5 100644 --- a/src/ai/movegen.cpp +++ b/src/ai/movegen.cpp @@ -364,7 +364,7 @@ void MoveList::shuffle() } - if (options.getRandomMoveEnabled()) { + if (gameOptions.getRandomMoveEnabled()) { uint32_t seed = static_cast(now()); std::shuffle(movePriorityTable0.begin(), movePriorityTable0.end(), std::default_random_engine(seed)); diff --git a/src/ai/search.cpp b/src/ai/search.cpp index d57f8bb1..d430b269 100644 --- a/src/ai/search.cpp +++ b/src/ai/search.cpp @@ -1033,7 +1033,7 @@ const char* AIAlgorithm::bestMove() #endif /* ENDGAME_LEARNING */ // 检查是否必败 - if (options.getGiveUpIfMostLose() == true) { + if (gameOptions.getGiveUpIfMostLose() == true) { bool isMostLose = true; // 是否必败 for (int j = 0; j < root->childrenSize; j++) { diff --git a/src/game/option.cpp b/src/game/option.cpp index fb51b71a..ff13b6a1 100644 --- a/src/game/option.cpp +++ b/src/game/option.cpp @@ -19,7 +19,7 @@ #include "option.h" -Options options; +Options gameOptions; void Options::setAutoRestart(bool enabled) { diff --git a/src/game/option.h b/src/game/option.h index f95a851c..678a8996 100644 --- a/src/game/option.h +++ b/src/game/option.h @@ -52,6 +52,6 @@ private: bool learnEndgame { false }; }; -extern Options options; +extern Options gameOptions; #endif /* OPTION_H */ diff --git a/src/ui/qt/gamecontroller.cpp b/src/ui/qt/gamecontroller.cpp index ce636469..17d825a3 100644 --- a/src/ui/qt/gamecontroller.cpp +++ b/src/ui/qt/gamecontroller.cpp @@ -172,7 +172,7 @@ void GameController::gameReset() tempGame = game; // 停掉线程 - if (!options.getAutoRestart()) { + if (!gameOptions.getAutoRestart()) { aiThread[BLACK]->stop(); aiThread[WHITE]->stop(); isAiPlayer[BLACK] = false; @@ -405,22 +405,22 @@ void GameController::playSound(const QString &soundPath) void GameController::setGiveUpIfMostLose(bool enabled) { - options.setGiveUpIfMostLose(enabled); + gameOptions.setGiveUpIfMostLose(enabled); } void GameController::setAutoRestart(bool enabled) { - options.setAutoRestart(enabled); + gameOptions.setAutoRestart(enabled); } void GameController::setRandomMove(bool enabled) { - options.setRandomMoveEnabled(enabled); + gameOptions.setRandomMoveEnabled(enabled); } void GameController::setLearnEndgame(bool enabled) { - options.setLearnEndgameEnabled(enabled); + gameOptions.setLearnEndgameEnabled(enabled); } // 上下翻转 @@ -1005,7 +1005,7 @@ bool GameController::command(const QString &cmd, bool update /* = true */) (aiThread[BLACK]->ai.hashHitCount + aiThread[WHITE]->ai.hashHitCount ) * 100 / (hashProbeCount_1 + hashProbeCount_2)); #endif // TRANSPOSITION_TABLE_DEBUG - if (options.getAutoRestart()) { + if (gameOptions.getAutoRestart()) { gameReset(); gameStart();