diff --git a/commondefs.cpp b/commondefs.cpp index 45f452b6ff2468921aa7482c04cd3f0aa569df7d..e1a3b8d982c64bce9b7554e73d2b66b09121588a 100644 --- a/commondefs.cpp +++ b/commondefs.cpp @@ -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); diff --git a/commondefs.h b/commondefs.h index b204c474a76ef8eab835a26ffa955498e36c9ed7..941e96abde3b1cfc2946c1939de211e1c2f71bf4 100644 --- a/commondefs.h +++ b/commondefs.h @@ -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 */ diff --git a/kreversigame.cpp b/kreversigame.cpp index 9524225a07bf00d9e48bf5100bae6f06427a960d..d009960d0c46787b3de6f266e183615804d3ba19 100644 --- a/kreversigame.cpp +++ b/kreversigame.cpp @@ -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) diff --git a/kreversigame.h b/kreversigame.h index 5a80c6c399f66acbf9c7069060ecfa1e4c97e550..4bb6702bf3a16177db4406150b03a4844f4d80cc 100644 --- a/kreversigame.h +++ b/kreversigame.h @@ -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 */ diff --git a/mainwindow.cpp b/mainwindow.cpp index 96b8c5867c9c905440a2bba0f3211871bca96d76..819956c8c747fa7446437bed7bd2c543c96e6685 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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),