Commit a0243986 authored by Laurent Montel's avatar Laurent Montel 😁

Fix clazy warning

parent d52bf802
......@@ -41,14 +41,14 @@ ChipColor Utils::opponentColorFor(ChipColor color)
}
QString Utils::colorToString(const ChipColor &color)
QString Utils::colorToString(ChipColor color)
{
if (Preferences::useColoredChips())
return (color == Black ? i18n("Blue") : i18n("Red"));
return (color == Black ? i18n("Black") : i18n("White"));
}
QString Utils::moveToString(const KReversiMove& move)
QString Utils::moveToString(KReversiMove move)
{
QString moveString = colorToString(move.color);
......
......@@ -67,7 +67,7 @@ struct KReversiMove: public KReversiPos {
KReversiMove(ChipColor col = NoColor, int r = -1, int c = -1)
: KReversiPos(r, c), color(col) { }
KReversiMove(ChipColor col, const KReversiPos &pos)
KReversiMove(ChipColor col, KReversiPos pos)
: KReversiPos(pos), color(col) { }
ChipColor color;
......@@ -109,11 +109,11 @@ ChipColor opponentColorFor(ChipColor color);
/**
* @return Human-readable string representing @p color
*/
QString colorToString(const ChipColor &color);
QString colorToString(ChipColor color);
/**
* @return Human-readable string representing @p move
*/
QString moveToString(const KReversiMove& move);
QString moveToString(KReversiMove move);
/**
* @return Index of current difficulty level in increasing order
*/
......
......@@ -75,7 +75,7 @@ bool KReversiGame::canUndo() const
return (m_player[m_curPlayer]->isUndoAllowed() && !m_undoStack.isEmpty());
}
void KReversiGame::makeMove(const KReversiMove &move)
void KReversiGame::makeMove(KReversiMove move)
{
if (!move.isValid()) {
kickCurrentPlayer();
......@@ -174,7 +174,7 @@ int KReversiGame::undo()
return movesUndone;
}
void KReversiGame::turnChips(const KReversiMove &move)
void KReversiGame::turnChips(KReversiMove move)
{
m_changedChips.clear();
......@@ -198,7 +198,7 @@ void KReversiGame::turnChips(const KReversiMove &move)
m_undoStack.push(m_changedChips);
}
bool KReversiGame::isMovePossible(const KReversiMove& move) const
bool KReversiGame::isMovePossible(KReversiMove move) const
{
// first - the trivial case:
if (m_cells[move.row][move.col] != NoColor || move.color == NoColor)
......@@ -211,7 +211,7 @@ bool KReversiGame::isMovePossible(const KReversiMove& move) const
return false;
}
bool KReversiGame::hasChunk(int dirNum, const KReversiMove& move) const
bool KReversiGame::hasChunk(int dirNum, KReversiMove move) const
{
// On each step (as we proceed) we must ensure that current chip is of the
// opponent color.
......@@ -367,7 +367,7 @@ int KReversiGame::playerScore(ChipColor player) const
return m_score[player];
}
void KReversiGame::setChipColor(const KReversiMove &move)
void KReversiGame::setChipColor(KReversiMove move)
{
// first: if the current cell already contains a chip we remove it
if (m_cells[move.row][move.col] != NoColor)
......
......@@ -177,11 +177,11 @@ private:
* This will make the player @p move
* If that is possible, of course
*/
void makeMove(const KReversiMove &move);
void makeMove(KReversiMove move);
/**
* This function will tell you if the move is possible.
*/
bool isMovePossible(const KReversiMove &move) const;
bool isMovePossible(KReversiMove move) const;
/**
* Searches for "chunk" in direction @p dirNum for @p move.
* As my English-skills are somewhat limited, let me introduce
......@@ -191,16 +191,16 @@ private:
* CO[O]C <-- this is a chunk
* where [O] is one or more opponent's pieces
*/
bool hasChunk(int dirNum, const KReversiMove &move) const;
bool hasChunk(int dirNum, KReversiMove move) const;
/**
* Performs @p move, i.e. marks all the chips that player wins with
* this move with current player color
*/
void turnChips(const KReversiMove &move);
void turnChips(KReversiMove move);
/**
* Sets the type of chip according to @p move
*/
void setChipColor(const KReversiMove &move);
void setChipColor(KReversiMove move);
/**
* Delay time
*/
......
......@@ -41,10 +41,6 @@
#include "kreversicomputerplayer.h"
#include "kexthighscore.h"
static const int BLACK_STATUSBAR_ID = 1;
static const int WHITE_STATUSBAR_ID = 2;
static const int COMMON_STATUSBAR_ID = 0;
KReversiMainWindow::KReversiMainWindow(QWidget* parent, bool startDemo)
: KXmlGuiWindow(parent),
m_startDialog(nullptr),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment