summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/patiencecardgame.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/solitaire/patiencecardgame.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/solitaire/patiencecardgame.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/noncore/games/solitaire/patiencecardgame.cpp b/noncore/games/solitaire/patiencecardgame.cpp
index 756577a..a1e4968 100644
--- a/noncore/games/solitaire/patiencecardgame.cpp
+++ b/noncore/games/solitaire/patiencecardgame.cpp
@@ -108,27 +108,27 @@ void PatienceCardGame::deal(void)
card->showCard();
highestZ++;
}
endDealing();
}
void PatienceCardGame::readConfig( Config& cfg )
{
cfg.setGroup("GameState");
+ deckTurns = cfg.readNumEntry("DeckTurns", 2500);
// Do we have a config file to read in?
- if ( !cfg.hasKey("numberOfTimesThroughDeck") )
- {
+ if ( !cfg.hasKey("numberOfTimesThroughDeck") ) {
// if not, create a new game
newGame();
return;
}
// We have a config file, lets read it in and use it
// Create Cards, but don't shuffle or deal them yet
createDeck();
// How many times through the deck have we been
numberOfTimesThroughDeck = cfg.readNumEntry("numberOfTimesThroughDeck");
@@ -268,12 +268,21 @@ void PatienceCardGame::mousePress(QPoint p)
card = faceUpDealingPile->cardOnTop();
highestZ++;
}
endDealing();
throughDeck();
moved = TRUE;
}
}
+bool PatienceCardGame::canTurnOverDeck() {
+ return (numberOfTimesThroughDeck != deckTurns);
+}
+
+void PatienceCardGame::throughDeck() {
+ numberOfTimesThroughDeck++;
+ if (numberOfTimesThroughDeck == deckTurns)
+ circleCross->setCross();
+ }