Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
Change-Id: If8c12158a28decc9f1a99c6f49b1003db61f1c63
  • Loading branch information
calcitem committed Nov 1, 2023
1 parent 7e71607 commit 96a6b5c
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 69 deletions.
55 changes: 11 additions & 44 deletions src/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,22 @@ 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
// state if multiple ones have equal evaluations. This introduces some
// 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
{
Expand Down Expand Up @@ -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

Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions src/perfect/perfect_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/perfect/perfect_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <iostream>
#include <iostream> // for std::cerr
#include <map>
#include <mutex> // for std::mutex and std::lock_guard
#include <mutex> // for std::mutex and std::lock_guard
#include <random>
#include <stdexcept>
#include <stdexcept> // for std::out_of_range
Expand Down
4 changes: 2 additions & 2 deletions src/perfect/perfect_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include <fstream>
#include <functional>
#include <iostream>
#include <iostream> // for std::cerr
#include <iostream> // for std::cerr
#include <map>
#include <mutex> // for std::mutex and std::lock_guard
#include <mutex> // for std::mutex and std::lock_guard
#include <stdexcept>
#include <stdexcept> // for std::out_of_range
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/perfect/perfect_sector_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ std::vector<Id> graph_func(Id u, bool elim_loops)

std::set<Id> 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<Id>(sr.begin(), sr.end());
}
Expand Down
3 changes: 2 additions & 1 deletion src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ bool Position::has_repeated(Sanmill::Stack<Position> &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
Expand Down
10 changes: 2 additions & 8 deletions src/tt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,14 @@ struct TTEntry
{
TTEntry() { }

Value value() const noexcept
{
return static_cast<Value>(value8);
}
Value value() const noexcept { return static_cast<Value>(value8); }

Depth depth() const noexcept
{
return static_cast<Depth>(depth8) + DEPTH_OFFSET;
}

Bound bound() const noexcept
{
return static_cast<Bound>(genBound8);
}
Bound bound() const noexcept { return static_cast<Bound>(genBound8); }

#ifdef TT_MOVE_ENABLE
Move tt_move() const noexcept { return (Move)(ttMove); }
Expand Down
3 changes: 1 addition & 2 deletions src/ui/qt/boarditem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 1 addition & 4 deletions src/ui/qt/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/ui/qt/game_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.


#include <QThread>

#include "game.h"
#include "option.h"


#if defined(GABOR_MALOM_PERFECT_AI)
#include "perfect/perfect_adaptor.h"
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/ui/qt/gamescene.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 96a6b5c

Please sign in to comment.