From 098b45a3ffa8297e93797b93b0d7f64c43c1ec11 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 9 Dec 2024 23:41:13 +0100 Subject: [PATCH] Adjust setupWinningDeck to make a bit harder deck --- src/gamestate.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gamestate.cpp b/src/gamestate.cpp index 9247222..391e7b0 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -71,7 +71,7 @@ void GameState::setupWinningDeck() { // Setup the foundation with all cards except one per suit for (int suit = 0; suit < 4; ++suit) { QList foundationPile; - for (int rank = 1; rank <= 12; ++rank) { // Leave the King (rank 13) out + for (int rank = 1; rank <= 11; ++rank) { // Leave the Queens & Kings (rank 2 & 13) out foundationPile.prepend(deck[suit * 13 + rank - 1]); } m_foundation[suit] = foundationPile; @@ -81,11 +81,22 @@ void GameState::setupWinningDeck() { for (int i = 0; i < 4; ++i) { QList column; PlayingCard* kingCard = deck[i * 13 + 12]; // King of each suit - ColumnSlot* slot = new ColumnSlot(kingCard, true, this); // Revealed + ColumnSlot* slot = new ColumnSlot(kingCard, i == 3, this); // Not revealed, except last column.append(slot); m_columns[i] = column; } + // Three of the remaining four Queens are placed over the Kings + for (int i = 0; i < 3; ++i) { + int queenSuit = (i + 2) % 4; // Opposite suit cyclically + PlayingCard* kingCard = deck[queenSuit * 13 + 11]; // Queen of each suit + ColumnSlot* slot = new ColumnSlot(kingCard, true, this); // Revealed + m_columns[i].append(slot); + } + + // Place the final Queen in the draw pile + m_drawPile.append(deck[1 * 13 + 11]); + emit drawPileChanged(); emit throwawayPileChanged(); emit columnsChanged();