diff --git a/src/gamestate.cpp b/src/gamestate.cpp index ccb7084..a6229fa 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -455,7 +455,7 @@ bool GameState::tryAutoMoveMultipleCards(const QList& cards, int s return false; } -bool GameState::isFoundationMoveValid(const PlayingCard& cardToMove, int foundationId) { +bool GameState::isFoundationMoveValid(const PlayingCard& cardToMove, int foundationId) const { assert(foundationId >= 0 && foundationId < 4); const auto foundationSuit = static_cast(foundationId); const auto& foundationStack = m_foundation[foundationId]; @@ -484,7 +484,7 @@ bool GameState::isFoundationMoveValid(const PlayingCard& cardToMove, int foundat return cardToMove.value() == requiredValue; } -bool GameState::isColumnMoveValid(const PlayingCard& cardToMove, int columnId) { +bool GameState::isColumnMoveValid(const PlayingCard& cardToMove, int columnId) const { assert(columnId >= 0 && columnId < 7); const auto& columnStack = m_columns[columnId]; diff --git a/src/gamestate.h b/src/gamestate.h index cbeaae7..e44df58 100644 --- a/src/gamestate.h +++ b/src/gamestate.h @@ -64,8 +64,8 @@ class GameState : public QObject { bool tryAutoMoveSingleCard(PlayingCard& cardToMove, int skipColumnId = -1); bool tryAutoMoveMultipleCards(const QList& cards, int skipColumnId); - bool isFoundationMoveValid(const PlayingCard& cardToMove, int foundationId); - bool isColumnMoveValid(const PlayingCard& cardToMove, int columnId); + bool isFoundationMoveValid(const PlayingCard& cardToMove, int foundationId) const; + bool isColumnMoveValid(const PlayingCard& cardToMove, int columnId) const; void ensureColumnRevealed(int columnId); };