Log warnings in certain unexpected branches

This commit is contained in:
ItsDrike 2024-12-03 01:50:52 +01:00
parent a1d676779d
commit 408457e7ce
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -78,7 +78,7 @@ bool GameState::moveCardToColumn(int columnId)
assert(columnId >= 0 && columnId < 7); assert(columnId >= 0 && columnId < 7);
if (m_throwawayPile.isEmpty()) { if (m_throwawayPile.isEmpty()) {
// Consider raising an exception here instead qWarning() << "Attempted to move thrown card to column with empty throwaway pile";
return false; return false;
} }
@ -123,7 +123,7 @@ bool GameState::moveCardToColumn(int columnId)
bool GameState::moveThrownCardToFoundation(PlayingCard::Suit foundationId) bool GameState::moveThrownCardToFoundation(PlayingCard::Suit foundationId)
{ {
if (m_throwawayPile.isEmpty()) { if (m_throwawayPile.isEmpty()) {
// Consider raising an exception here instead qWarning() << "Attempted to move thrown card to foundation with empty throwaway pile";
return false; return false;
} }
@ -147,7 +147,7 @@ bool GameState::moveColumnCardToFoundation(int columnId, PlayingCard::Suit found
assert(columnId >= 0 && columnId < 7); assert(columnId >= 0 && columnId < 7);
if (m_columns[columnId].isEmpty()) { if (m_columns[columnId].isEmpty()) {
// Consider raising an exception here instead qWarning() << "Attempted to move card to foundation from an empty column";
return false; return false;
} }