author | llornkcor <llornkcor> | 2004-04-26 10:24:35 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-26 10:24:35 (UTC) |
commit | f6a98984fcb0dfc7e176636560b7cc1adacf38f2 (patch) (side-by-side diff) | |
tree | f358b16531551035a54c1dac95e16a36f86f8dc9 /noncore/games | |
parent | 57d7f3faf053786925d2315e43ab6ba8d892f51a (diff) | |
download | opie-f6a98984fcb0dfc7e176636560b7cc1adacf38f2.zip opie-f6a98984fcb0dfc7e176636560b7cc1adacf38f2.tar.gz opie-f6a98984fcb0dfc7e176636560b7cc1adacf38f2.tar.bz2 |
turn off silly casino rules solitare
-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 @@ -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 @@ -19,5 +19,5 @@ **********************************************************************/ #ifndef PATIENCE_CARD_GAME_H -#define PATIENCE_CARD_GAME_H +#define PATIENCE_CARD_GAME_H @@ -47,5 +47,5 @@ public: if ( card == cardOnTop() ) return TRUE; - return FALSE; + return FALSE; } }; @@ -67,5 +67,5 @@ public: if ( card == cardOnTop() ) return TRUE; - return FALSE; + return FALSE; } }; @@ -84,10 +84,10 @@ public: ( card->getSuit() == cardOnTop()->getSuit() ) ) ) ) return TRUE; - return FALSE; + return FALSE; } virtual bool isAllowedToBeMoved(Card *card) { if ( card->isFacing() && ( card == cardOnTop() ) ) return TRUE; - return FALSE; + return FALSE; } }; @@ -106,10 +106,10 @@ public: ( card->isRed() != cardOnTop()->isRed() ) ) ) ) return TRUE; - return FALSE; + return FALSE; } virtual bool isAllowedToBeMoved(Card *card) { if ( card->isFacing() ) return TRUE; - return FALSE; + return FALSE; } virtual void cardAddedToTop(Card *card) { @@ -149,10 +149,10 @@ public: if (card->isFacing()) { 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); } return QPoint( x, y ); @@ -174,5 +174,6 @@ public: virtual ~PatienceCardGame(); virtual void deal(void); - virtual bool haveWeWon() { + int deckTurns; + virtual bool haveWeWon() { return ( discardPiles[0]->kingOnTop() && discardPiles[1]->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 ); |