summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire
authorar <ar>2004-06-03 21:13:20 (UTC)
committer ar <ar>2004-06-03 21:13:20 (UTC)
commit9f12abfa6b60232592aa15feea25bee28908f525 (patch) (unidiff)
treeaf16be15cd597cdf01d8476f478f3bbe7dc81509 /noncore/games/solitaire
parent52f849d3031f9d2fad2272ad069e7a1456c0ee54 (diff)
downloadopie-9f12abfa6b60232592aa15feea25bee28908f525.zip
opie-9f12abfa6b60232592aa15feea25bee28908f525.tar.gz
opie-9f12abfa6b60232592aa15feea25bee28908f525.tar.bz2
- turn on casino rules in solitare (make it eventually configurable)
Diffstat (limited to 'noncore/games/solitaire') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/solitaire/patiencecardgame.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/games/solitaire/patiencecardgame.cpp b/noncore/games/solitaire/patiencecardgame.cpp
index a1e4968..00448ad 100644
--- a/noncore/games/solitaire/patiencecardgame.cpp
+++ b/noncore/games/solitaire/patiencecardgame.cpp
@@ -16,8 +16,9 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#include "patiencecardgame.h" 21#include "patiencecardgame.h"
21 22
22 23
23int highestZ = 0; 24int highestZ = 0;
@@ -116,11 +117,13 @@ void PatienceCardGame::deal(void)
116void PatienceCardGame::readConfig( Config& cfg ) 117void PatienceCardGame::readConfig( Config& cfg )
117{ 118{
118 cfg.setGroup("GameState"); 119 cfg.setGroup("GameState");
119 120
120 deckTurns = cfg.readNumEntry("DeckTurns", 2500); 121 // todo: make this eventually configurable
122 deckTurns = cfg.readNumEntry("DeckTurns", 2);
121 // Do we have a config file to read in? 123 // Do we have a config file to read in?
122 if ( !cfg.hasKey("numberOfTimesThroughDeck") ) { 124 if ( !cfg.hasKey("numberOfTimesThroughDeck") )
125 {
123 // if not, create a new game 126 // if not, create a new game
124 newGame(); 127 newGame();
125 return; 128 return;
126 } 129 }
@@ -275,14 +278,15 @@ void PatienceCardGame::mousePress(QPoint p)
275 moved = TRUE; 278 moved = TRUE;
276 } 279 }
277} 280}
278 281
279 282bool PatienceCardGame::canTurnOverDeck()
280bool PatienceCardGame::canTurnOverDeck() { 283{
281 return (numberOfTimesThroughDeck != deckTurns); 284 return (numberOfTimesThroughDeck != deckTurns);
282} 285}
283 286
284void PatienceCardGame::throughDeck() { 287void PatienceCardGame::throughDeck()
288{
285 numberOfTimesThroughDeck++; 289 numberOfTimesThroughDeck++;
286 if (numberOfTimesThroughDeck == deckTurns) 290 if (numberOfTimesThroughDeck == deckTurns)
287 circleCross->setCross(); 291 circleCross->setCross();
288 } 292 }