-rw-r--r-- | noncore/games/solitaire/patiencecardgame.cpp | 13 | ||||
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.h | 9 |
2 files changed, 14 insertions, 8 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 @@ -118,7 +118,7 @@ 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(); @@ -278,2 +278,11 @@ void PatienceCardGame::mousePress(QPoint p) +bool PatienceCardGame::canTurnOverDeck() { + return (numberOfTimesThroughDeck != deckTurns); +} + +void PatienceCardGame::throughDeck() { + numberOfTimesThroughDeck++; + if (numberOfTimesThroughDeck == deckTurns) + circleCross->setCross(); + } diff --git a/noncore/games/solitaire/patiencecardgame.h b/noncore/games/solitaire/patiencecardgame.h index 0d0e3d5..b76251a 100644 --- a/noncore/games/solitaire/patiencecardgame.h +++ b/noncore/games/solitaire/patiencecardgame.h @@ -174,4 +174,5 @@ public: virtual ~PatienceCardGame(); virtual void deal(void); + int deckTurns; virtual bool haveWeWon() { return ( discardPiles[0]->kingOnTop() && @@ -186,10 +187,6 @@ public: virtual void mouseReleaseCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } // virtual void mouseMoveCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } - bool canTurnOverDeck(void) { return (numberOfTimesThroughDeck != 3); } - void throughDeck(void) { - numberOfTimesThroughDeck++; - if (numberOfTimesThroughDeck == 3) - circleCross->setCross(); - } + bool canTurnOverDeck(); + void throughDeck(); bool snapOn; virtual void writeConfig( Config& cfg ); |