From 96a6b5ce6437c2732fb185370a79612f072d2950 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 1 Nov 2023 21:39:50 +0800 Subject: [PATCH] Format Change-Id: If8c12158a28decc9f1a99c6f49b1003db61f1c63 --- src/option.h | 55 ++++++---------------------- src/perfect/perfect_common.h | 4 +- src/perfect/perfect_player.cpp | 2 +- src/perfect/perfect_player.h | 4 +- src/perfect/perfect_sector_graph.cpp | 2 +- src/position.cpp | 3 +- src/tt.h | 10 +---- src/ui/qt/boarditem.h | 3 +- src/ui/qt/game.h | 5 +-- src/ui/qt/game_ai.cpp | 2 - src/ui/qt/gamescene.h | 3 +- 11 files changed, 24 insertions(+), 69 deletions(-) diff --git a/src/option.h b/src/option.h index 2a08e3731..d20e0d41f 100644 --- a/src/option.h +++ b/src/option.h @@ -57,10 +57,7 @@ class GameOptions resignIfMostLose = enabled; } - bool getResignIfMostLose() const noexcept - { - return resignIfMostLose; - } + bool getResignIfMostLose() const noexcept { return resignIfMostLose; } // Specify whether the successors of a given state should be shuffled if a // re-evaluation is required so that the AI algorithm is not favoring one @@ -68,20 +65,14 @@ class GameOptions // variation between different games against an opponent that tries to do // the same sequence of moves. By default, shuffling is enabled. - bool getShufflingEnabled() const noexcept - { - return shufflingEnabled; - } + bool getShufflingEnabled() const noexcept { return shufflingEnabled; } void setShufflingEnabled(bool enabled) noexcept { shufflingEnabled = enabled; } - bool getLearnEndgameEnabled() const noexcept - { - return learnEndgame; - } + bool getLearnEndgameEnabled() const noexcept { return learnEndgame; } void setLearnEndgameEnabled(bool enabled) noexcept { @@ -109,10 +100,7 @@ class GameOptions void setDepthExtension(bool enabled) noexcept { depthExtension = enabled; } - bool getDepthExtension() const noexcept - { - return depthExtension; - } + bool getDepthExtension() const noexcept { return depthExtension; } // OpeningBook @@ -129,10 +117,7 @@ class GameOptions } } - bool getAlphaBetaAlgorithm() const noexcept - { - return algorithm == 0; - } + bool getAlphaBetaAlgorithm() const noexcept { return algorithm == 0; } void setPvsAlgorithm(bool enabled) noexcept { @@ -141,10 +126,7 @@ class GameOptions } } - bool getPvsAlgorithm() const noexcept - { - return algorithm == 1; - } + bool getPvsAlgorithm() const noexcept { return algorithm == 1; } void setMtdfAlgorithm(bool enabled) noexcept { @@ -153,10 +135,7 @@ class GameOptions } } - bool getMtdfAlgorithm() const noexcept - { - return algorithm == 2; - } + bool getMtdfAlgorithm() const noexcept { return algorithm == 2; } void setMctsAlgorithm(bool enabled) noexcept { @@ -165,10 +144,7 @@ class GameOptions } } - bool getMctsAlgorithm() const noexcept - { - return algorithm == 3; - } + bool getMctsAlgorithm() const noexcept { return algorithm == 3; } void setAlgorithm(int val) noexcept { @@ -224,10 +200,7 @@ class GameOptions usePerfectDatabase = enabled; } - bool getUsePerfectDatabase() const noexcept - { - return usePerfectDatabase; - } + bool getUsePerfectDatabase() const noexcept { return usePerfectDatabase; } void setPerfectDatabasePath(std::string val) noexcept { @@ -258,19 +231,13 @@ class GameOptions considerMobility = enabled; } - bool getConsiderMobility() const noexcept - { - return considerMobility; - } + bool getConsiderMobility() const noexcept { return considerMobility; } // Developer Mode void setDeveloperMode(bool enabled) noexcept { developerMode = enabled; } - bool getDeveloperMode() const noexcept - { - return developerMode; - } + bool getDeveloperMode() const noexcept { return developerMode; } private: int skillLevel {1}; diff --git a/src/perfect/perfect_common.h b/src/perfect/perfect_common.h index 9d96702c3..003da89ed 100644 --- a/src/perfect/perfect_common.h +++ b/src/perfect/perfect_common.h @@ -39,7 +39,7 @@ along with this program. If not, see . #define RULE_VARIANT STANDARD // STANDARD, MORABARABA, or LASKER -#define FULL_BOARD_IS_DRAW 1 // 0 or 1 +#define FULL_BOARD_IS_DRAW 1 // 0 or 1 // #define FULL_SECTOR_GRAPH //extended solution //comment or uncomment @@ -66,7 +66,7 @@ static_assert(false, "sec_val range"); #ifndef STONE_DIFF const int eval_struct_size = 3; // byte #if RULE_VARIANT == STANDARD -const int field2_offset = 12; // bit +const int field2_offset = 12; // bit #else const int field2_offset = 14; // bit #endif diff --git a/src/perfect/perfect_player.cpp b/src/perfect/perfect_player.cpp index e91cc22b0..4e9cb90a1 100644 --- a/src/perfect/perfect_player.cpp +++ b/src/perfect/perfect_player.cpp @@ -36,7 +36,7 @@ #include #include // for std::cerr #include -#include // for std::mutex and std::lock_guard +#include // for std::mutex and std::lock_guard #include #include #include // for std::out_of_range diff --git a/src/perfect/perfect_player.h b/src/perfect/perfect_player.h index 8f66ace49..6315fd81f 100644 --- a/src/perfect/perfect_player.h +++ b/src/perfect/perfect_player.h @@ -37,9 +37,9 @@ #include #include #include -#include // for std::cerr +#include // for std::cerr #include -#include // for std::mutex and std::lock_guard +#include // for std::mutex and std::lock_guard #include #include // for std::out_of_range #include diff --git a/src/perfect/perfect_sector_graph.cpp b/src/perfect/perfect_sector_graph.cpp index ef98cf44e..eb0b0e5e8 100644 --- a/src/perfect/perfect_sector_graph.cpp +++ b/src/perfect/perfect_sector_graph.cpp @@ -100,7 +100,7 @@ std::vector graph_func(Id u, bool elim_loops) std::set sr(r0.begin(), r0.end()); // parallel electric discharge if (elim_loops) - sr.erase(u); // kizurese of hurokel + sr.erase(u); // kizurese of hurokel return std::vector(sr.begin(), sr.end()); } diff --git a/src/position.cpp b/src/position.cpp index 08b76848c..47102b936 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -601,7 +601,8 @@ bool Position::has_repeated(Sanmill::Stack &ss) const bool Position::has_game_cycle() const { - ptrdiff_t count = std::count(posKeyHistory.begin(), posKeyHistory.end(), key()); + ptrdiff_t count = std::count(posKeyHistory.begin(), posKeyHistory.end(), + key()); // TODO: Maintain consistent interface behavior #ifdef QT_GUI_LIB diff --git a/src/tt.h b/src/tt.h index cc95a9209..ab3466c3b 100644 --- a/src/tt.h +++ b/src/tt.h @@ -35,20 +35,14 @@ struct TTEntry { TTEntry() { } - Value value() const noexcept - { - return static_cast(value8); - } + Value value() const noexcept { return static_cast(value8); } Depth depth() const noexcept { return static_cast(depth8) + DEPTH_OFFSET; } - Bound bound() const noexcept - { - return static_cast(genBound8); - } + Bound bound() const noexcept { return static_cast(genBound8); } #ifdef TT_MOVE_ENABLE Move tt_move() const noexcept { return (Move)(ttMove); } diff --git a/src/ui/qt/boarditem.h b/src/ui/qt/boarditem.h index 3bc30b1f6..9cc0faf6e 100644 --- a/src/ui/qt/boarditem.h +++ b/src/ui/qt/boarditem.h @@ -55,8 +55,7 @@ class BoardItem : public QGraphicsItem QPointF polarCoordinateToPoint(File f, Rank r) const; // Convert Cartesian point to polar coordinates (File and Rank) - bool pointToPolarCoordinate(QPointF point, File &f, - Rank &r) const; + bool pointToPolarCoordinate(QPointF point, File &f, Rank &r) const; void updateAdvantageBar(qreal newAdvantage); diff --git a/src/ui/qt/game.h b/src/ui/qt/game.h index 2d1abfbc3..8fc71b3c1 100644 --- a/src/ui/qt/game.h +++ b/src/ui/qt/game.h @@ -474,10 +474,7 @@ public slots: AiSharedMemoryDialog *getTest() const { return gameTest; } - DatabaseDialog *getDatabaseDialog() const - { - return databaseDialog; - } + DatabaseDialog *getDatabaseDialog() const { return databaseDialog; } protected: // bool eventFilter(QObject * watched, QEvent * event); diff --git a/src/ui/qt/game_ai.cpp b/src/ui/qt/game_ai.cpp index ffbfaf039..f1459c5b4 100644 --- a/src/ui/qt/game_ai.cpp +++ b/src/ui/qt/game_ai.cpp @@ -14,13 +14,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - #include #include "game.h" #include "option.h" - #if defined(GABOR_MALOM_PERFECT_AI) #include "perfect/perfect_adaptor.h" #endif diff --git a/src/ui/qt/gamescene.h b/src/ui/qt/gamescene.h index 01126a57e..5e0b06008 100644 --- a/src/ui/qt/gamescene.h +++ b/src/ui/qt/gamescene.h @@ -36,8 +36,7 @@ class GameScene : public QGraphicsScene QPointF polarCoordinateToPoint(File f, Rank r) const; - bool pointToPolarCoordinate(QPointF pos, File &f, - Rank &r) const; + bool pointToPolarCoordinate(QPointF pos, File &f, Rank &r) const; void setDiagonal(bool arg = true) const;