-rw-r--r-- | noncore/games/solitaire/patiencecardgame.cpp | 13 | ||||
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.h | 31 |
2 files changed, 25 insertions, 19 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 @@ -119,5 +119,5 @@ void PatienceCardGame::readConfig( Config& cfg ) + 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 @@ -279 +279,10 @@ 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 @@ -20,3 +20,3 @@ #ifndef PATIENCE_CARD_GAME_H -#define PATIENCE_CARD_GAME_H +#define PATIENCE_CARD_GAME_H @@ -48,3 +48,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -68,3 +68,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -85,3 +85,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -90,3 +90,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -107,3 +107,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -112,3 +112,3 @@ public: return TRUE; - return FALSE; + return FALSE; } @@ -150,8 +150,8 @@ public: int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; - y += offsetDown; + y += offsetDown; } else { - x += 1; + x += 1; y += 3; } - card = cardInfront(card); + card = cardInfront(card); } @@ -175,3 +175,4 @@ public: virtual void deal(void); - virtual bool haveWeWon() { + int deckTurns; + virtual bool haveWeWon() { return ( discardPiles[0]->kingOnTop() && @@ -187,8 +188,4 @@ public: // 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; |