summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/patiencecardgame.cpp
Unidiff
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)
108 card->showCard(); 108 card->showCard();
109 highestZ++; 109 highestZ++;
110 } 110 }
111 111
112 endDealing(); 112 endDealing();
113} 113}
114 114
115 115
116void PatienceCardGame::readConfig( Config& cfg ) 116void PatienceCardGame::readConfig( Config& cfg )
117{ 117{
118 cfg.setGroup("GameState"); 118 cfg.setGroup("GameState");
119 119
120 deckTurns = cfg.readNumEntry("DeckTurns", 2500);
120 // Do we have a config file to read in? 121 // Do we have a config file to read in?
121 if ( !cfg.hasKey("numberOfTimesThroughDeck") ) 122 if ( !cfg.hasKey("numberOfTimesThroughDeck") ) {
122 {
123 // if not, create a new game 123 // if not, create a new game
124 newGame(); 124 newGame();
125 return; 125 return;
126 } 126 }
127 // We have a config file, lets read it in and use it 127 // We have a config file, lets read it in and use it
128 128
129 // Create Cards, but don't shuffle or deal them yet 129 // Create Cards, but don't shuffle or deal them yet
130 createDeck(); 130 createDeck();
131 131
132 // How many times through the deck have we been 132 // How many times through the deck have we been
133 numberOfTimesThroughDeck = cfg.readNumEntry("numberOfTimesThroughDeck"); 133 numberOfTimesThroughDeck = cfg.readNumEntry("numberOfTimesThroughDeck");
134 134
@@ -268,12 +268,21 @@ void PatienceCardGame::mousePress(QPoint p)
268 card = faceUpDealingPile->cardOnTop(); 268 card = faceUpDealingPile->cardOnTop();
269 highestZ++; 269 highestZ++;
270 } 270 }
271 endDealing(); 271 endDealing();
272 272
273 throughDeck(); 273 throughDeck();
274 274
275 moved = TRUE; 275 moved = TRUE;
276 } 276 }
277} 277}
278 278
279 279
280bool PatienceCardGame::canTurnOverDeck() {
281 return (numberOfTimesThroughDeck != deckTurns);
282}
283
284void PatienceCardGame::throughDeck() {
285 numberOfTimesThroughDeck++;
286 if (numberOfTimesThroughDeck == deckTurns)
287 circleCross->setCross();
288 }