clean up ensureColumnRevealed method

This commit is contained in:
ItsDrike 2024-12-04 18:02:54 +01:00
parent 5696e244f2
commit 548d36a358
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -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<PlayingCard *> GameState::drawPile() const