clean up ensureColumnRevealed method
This commit is contained in:
parent
5696e244f2
commit
548d36a358
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue