Diffstat (limited to 'noncore/games/solitaire/patiencecardgame.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.cpp | 26 |
1 files changed, 15 insertions, 11 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 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ + #include "patiencecardgame.h" int highestZ = 0; @@ -116,11 +117,13 @@ void PatienceCardGame::deal(void) void PatienceCardGame::readConfig( Config& cfg ) { cfg.setGroup("GameState"); - deckTurns = cfg.readNumEntry("DeckTurns", 2500); + // todo: make this eventually configurable + deckTurns = cfg.readNumEntry("DeckTurns", 2); // Do we have a config file to read in? - if ( !cfg.hasKey("numberOfTimesThroughDeck") ) { + if ( !cfg.hasKey("numberOfTimesThroughDeck") ) + { // if not, create a new game newGame(); return; } @@ -210,9 +213,9 @@ bool PatienceCardGame::mousePressCard( Card *card, QPoint p ) item->flipTo( 30, (int)item->y() ); else item->flipTo( 35, (int)item->y() ); } - else return FALSE; // <- was missing, caused facedown card to react + else return FALSE; // <- was missing, caused facedown card to react // to clicking, which is wrong moving = NULL; moved = FALSE; @@ -275,14 +278,15 @@ void PatienceCardGame::mousePress(QPoint p) moved = TRUE; } } - -bool PatienceCardGame::canTurnOverDeck() { - return (numberOfTimesThroughDeck != deckTurns); +bool PatienceCardGame::canTurnOverDeck() +{ + return (numberOfTimesThroughDeck != deckTurns); } -void PatienceCardGame::throughDeck() { - numberOfTimesThroughDeck++; - if (numberOfTimesThroughDeck == deckTurns) - circleCross->setCross(); - } +void PatienceCardGame::throughDeck() +{ + numberOfTimesThroughDeck++; + if (numberOfTimesThroughDeck == deckTurns) + circleCross->setCross(); +} |