Diffstat (limited to 'noncore/games/solitaire/patiencecardgame.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.h | 9 |
1 files changed, 3 insertions, 6 deletions
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 | |||
@@ -152,58 +152,55 @@ public: | |||
152 | } else { | 152 | } else { |
153 | x += 1; | 153 | x += 1; |
154 | y += 3; | 154 | y += 3; |
155 | } | 155 | } |
156 | card = cardInfront(card); | 156 | card = cardInfront(card); |
157 | } | 157 | } |
158 | return QPoint( x, y ); | 158 | return QPoint( x, y ); |
159 | } | 159 | } |
160 | virtual QPoint getHypertheticalNextCardPos(void) { | 160 | virtual QPoint getHypertheticalNextCardPos(void) { |
161 | return top; | 161 | return top; |
162 | // return QPoint( getNextX(), getNextY() ); | 162 | // return QPoint( getNextX(), getNextY() ); |
163 | } | 163 | } |
164 | private: | 164 | private: |
165 | QPoint top; | 165 | QPoint top; |
166 | 166 | ||
167 | }; | 167 | }; |
168 | 168 | ||
169 | 169 | ||
170 | class PatienceCardGame : public CanvasCardGame | 170 | class PatienceCardGame : public CanvasCardGame |
171 | { | 171 | { |
172 | public: | 172 | public: |
173 | PatienceCardGame(QCanvas *c, bool snap, QWidget *parent = 0); | 173 | PatienceCardGame(QCanvas *c, bool snap, QWidget *parent = 0); |
174 | virtual ~PatienceCardGame(); | 174 | virtual ~PatienceCardGame(); |
175 | virtual void deal(void); | 175 | virtual void deal(void); |
176 | int deckTurns; | ||
176 | virtual bool haveWeWon() { | 177 | virtual bool haveWeWon() { |
177 | return ( discardPiles[0]->kingOnTop() && | 178 | return ( discardPiles[0]->kingOnTop() && |
178 | discardPiles[1]->kingOnTop() && | 179 | discardPiles[1]->kingOnTop() && |
179 | discardPiles[2]->kingOnTop() && | 180 | discardPiles[2]->kingOnTop() && |
180 | discardPiles[3]->kingOnTop() );; | 181 | discardPiles[3]->kingOnTop() );; |
181 | } | 182 | } |
182 | virtual void mousePress(QPoint p); | 183 | virtual void mousePress(QPoint p); |
183 | virtual void mouseRelease(QPoint p) { Q_UNUSED(p); } | 184 | virtual void mouseRelease(QPoint p) { Q_UNUSED(p); } |
184 | // virtual void mouseMove(QPoint p); | 185 | // virtual void mouseMove(QPoint p); |
185 | virtual bool mousePressCard(Card *card, QPoint p); | 186 | virtual bool mousePressCard(Card *card, QPoint p); |
186 | virtual void mouseReleaseCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } | 187 | virtual void mouseReleaseCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } |
187 | // virtual void mouseMoveCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } | 188 | // virtual void mouseMoveCard(Card *card, QPoint p) { Q_UNUSED(card); Q_UNUSED(p); } |
188 | bool canTurnOverDeck(void) { return (numberOfTimesThroughDeck != 3); } | 189 | bool canTurnOverDeck(); |
189 | void throughDeck(void) { | 190 | void throughDeck(); |
190 | numberOfTimesThroughDeck++; | ||
191 | if (numberOfTimesThroughDeck == 3) | ||
192 | circleCross->setCross(); | ||
193 | } | ||
194 | bool snapOn; | 191 | bool snapOn; |
195 | virtual void writeConfig( Config& cfg ); | 192 | virtual void writeConfig( Config& cfg ); |
196 | virtual void readConfig( Config& cfg ); | 193 | virtual void readConfig( Config& cfg ); |
197 | private: | 194 | private: |
198 | CanvasCircleOrCross *circleCross; | 195 | CanvasCircleOrCross *circleCross; |
199 | CanvasRoundRect *rectangle; | 196 | CanvasRoundRect *rectangle; |
200 | PatienceWorkingPile *workingPiles[7]; | 197 | PatienceWorkingPile *workingPiles[7]; |
201 | PatienceDiscardPile *discardPiles[4]; | 198 | PatienceDiscardPile *discardPiles[4]; |
202 | PatienceFaceDownDeck *faceDownDealingPile; | 199 | PatienceFaceDownDeck *faceDownDealingPile; |
203 | PatienceFaceUpDeck *faceUpDealingPile; | 200 | PatienceFaceUpDeck *faceUpDealingPile; |
204 | int numberOfTimesThroughDeck; | 201 | int numberOfTimesThroughDeck; |
205 | }; | 202 | }; |
206 | 203 | ||
207 | 204 | ||
208 | #endif | 205 | #endif |
209 | 206 | ||