From 2b44a39ee88910d17bfaeb4ac79aec5001593956 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 6 Dec 2024 17:09:19 +0100 Subject: [PATCH] slight code clean up --- src/gamestate.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gamestate.cpp b/src/gamestate.cpp index 878b993..c2e3081 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -451,7 +451,6 @@ void GameState::cleanupBoard(bool emitChanges) { QString GameState::generateStateHash() const { QString stateHash; - // The repetition here is annoying, I know for (const auto& column : m_columns) { for (const ColumnSlot* slot : column) { stateHash += QString::number(slot->card()->value()) + "." + QString::number(slot->card()->suit()); @@ -592,10 +591,8 @@ bool GameState::isColumnMoveValid(const PlayingCard& cardToMove, int columnId) c const PlayingCard& columnCard = *columnStack.last()->card(); // The card's value must be one less than the card in the column - if (cardToMove.value() != columnCard.value() - 1) { - qDebug() << "* Move attempt failed (wrong value)"; + if (cardToMove.value() != static_cast(static_cast(columnCard.value() - 1))) return false; - } // The card must be of opposite color return PlayingCard::areOppositeColors(cardToMove, columnCard);