From 548d36a358b4aa8d21d6413073dde40401abb2fc Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 4 Dec 2024 18:02:54 +0100 Subject: [PATCH] clean up ensureColumnRevealed method --- gamestate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamestate.cpp b/gamestate.cpp index 53efc18..e0a9764 100644 --- a/gamestate.cpp +++ b/gamestate.cpp @@ -448,13 +448,14 @@ bool GameState::isColumnMoveValid(const PlayingCard& cardToMove, int columnId) { void GameState::ensureColumnRevealed(int columnId) { assert(columnId >= 0 && columnId < 7); + auto& columnStack = m_columns[columnId]; // Nothing to reveal if (m_columns[columnId].isEmpty()) return; // Get the last column slot - ColumnSlot *col = m_columns[columnId].last(); + ColumnSlot *col = columnStack.last(); // If it's already revealed, there's nothing to do if (col->isRevealed()) @@ -462,6 +463,7 @@ void GameState::ensureColumnRevealed(int columnId) // First slot in the column must always be revealed, reveal it col->reveal(); + qDebug() << "Revealed card " << col->card()->toString() << " in column " << columnId; } QList GameState::drawPile() const