summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/solitaire/canvascardgame.cpp4
-rw-r--r--noncore/games/solitaire/chicanecardgame.cpp8
-rw-r--r--noncore/games/solitaire/chicanecardgame.h17
-rw-r--r--noncore/games/solitaire/harpcardgame.cpp10
-rw-r--r--noncore/games/solitaire/harpcardgame.h18
-rw-r--r--noncore/games/solitaire/teeclubcardgame.cpp12
-rw-r--r--noncore/games/solitaire/teeclubcardgame.h27
7 files changed, 74 insertions, 22 deletions
diff --git a/noncore/games/solitaire/canvascardgame.cpp b/noncore/games/solitaire/canvascardgame.cpp
index 4404b04..8e07cc8 100644
--- a/noncore/games/solitaire/canvascardgame.cpp
+++ b/noncore/games/solitaire/canvascardgame.cpp
@@ -375,8 +375,8 @@ void CanvasCardGame::readPile( Config& cfg, CardPile *pile, QString name, int& h
375 375
376 card = cards[ val ]; 376 card = cards[ val ];
377 card->setFace(facing); 377 card->setFace(facing);
378 card->setCardPile(pile); // cam: setCardPile muss vor addCardToTop passieren 378 card->setCardPile(pile); // cam: setCardPile has to happen bevor addCardToTop
379 pile->addCardToTop(card); // weil sonst absturz wg cardAddedToTop 379 pile->addCardToTop(card); // due to a empty pointer if you use cardAddedToTop
380 QPoint p = pile->getCardPos( card ); 380 QPoint p = pile->getCardPos( card );
381 card->setPos( p.x(), p.y(), highestZ ); 381 card->setPos( p.x(), p.y(), highestZ );
382 card->showCard(); 382 card->showCard();
diff --git a/noncore/games/solitaire/chicanecardgame.cpp b/noncore/games/solitaire/chicanecardgame.cpp
index a242419..6729a94 100644
--- a/noncore/games/solitaire/chicanecardgame.cpp
+++ b/noncore/games/solitaire/chicanecardgame.cpp
@@ -17,7 +17,13 @@
17** not clear to you. 17** not clear to you.
18** 18**
19** 19**
20** Modified by C.A.Mader 2002 20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22 **use 2 decks = 104 cards
23 **deal 8 rows with 3 hidden cards and one open card
24** append red to black and vice versa
25 **each card can be layed on a free place
26 **deal 8 cards at once
21** 27**
22**********************************************************************/ 28**********************************************************************/
23#include <qgfx_qws.h> 29#include <qgfx_qws.h>
diff --git a/noncore/games/solitaire/chicanecardgame.h b/noncore/games/solitaire/chicanecardgame.h
index 668f5f4..f6bd08e 100644
--- a/noncore/games/solitaire/chicanecardgame.h
+++ b/noncore/games/solitaire/chicanecardgame.h
@@ -16,6 +16,15 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**
20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22** use 2 decks = 104 cards
23** deal 8 rows with 3 hidden cards and one open card
24** append red to black and vice versa
25** each card can be layed on a free place
26** deal 8 cards at once
27**
19**********************************************************************/ 28**********************************************************************/
20#ifndef CHICANE_CARD_GAME_H 29#ifndef CHICANE_CARD_GAME_H
21#define CHICANE_CARD_GAME_H 30#define CHICANE_CARD_GAME_H
@@ -50,8 +59,8 @@ public:
50 59
51 virtual bool isAllowedOnTop(Card *card) { 60 virtual bool isAllowedOnTop(Card *card) {
52 if ( card->isFacing() && 61 if ( card->isFacing() &&
53 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // diese Zeile sorgt dafür dass nur Kings auf leere Plätze dürfen 62 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // only kings are allowed on empty places
54 ( (cardOnTop() == NULL) || // auf einen Freiplatz darf alles! 63 ( (cardOnTop() == NULL) || // each card can use an empty place
55 ( (cardOnTop() != NULL) && 64 ( (cardOnTop() != NULL) &&
56 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) && 65 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) &&
57 (card->isRed() != cardOnTop()->isRed()) ) ) ) 66 (card->isRed() != cardOnTop()->isRed()) ) ) )
@@ -92,7 +101,7 @@ public:
92 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; 101 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
93 // correct the position taking in to account the card is not 102 // correct the position taking in to account the card is not
94 // yet flipped, but will become flipped 103 // yet flipped, but will become flipped
95 top = QPoint( top.x(), top.y() - 3 ); // Keine Verschiebung! 104 top = QPoint( top.x(), top.y() - 3 ); // no moving to the side
96 newTopCard->flipTo( top.x(), top.y() ); 105 newTopCard->flipTo( top.x(), top.y() );
97 top = QPoint( top.x(), top.y() + offsetDown ); 106 top = QPoint( top.x(), top.y() + offsetDown );
98 } 107 }
@@ -108,7 +117,7 @@ public:
108 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; 117 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
109 y += offsetDown; 118 y += offsetDown;
110 } else { 119 } else {
111 x += 0; // Keine Verschiebung! 120 x += 0; // no moving to the side
112 y += 3; 121 y += 3;
113 } 122 }
114 card = cardInfront(card); 123 card = cardInfront(card);
diff --git a/noncore/games/solitaire/harpcardgame.cpp b/noncore/games/solitaire/harpcardgame.cpp
index 22715ec..0711622 100644
--- a/noncore/games/solitaire/harpcardgame.cpp
+++ b/noncore/games/solitaire/harpcardgame.cpp
@@ -17,7 +17,15 @@
17** not clear to you. 17** not clear to you.
18** 18**
19** 19**
20** Modified by C.A.Mader 2002 20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22** use 2 decks = 104 cards
23** deal 8 rows with one open card in the first place
24** one hidden and one open in the second place and so on
25** append red to black and vice versa
26** each card can be layed on a free place
27** deal 8 cards at once
28**
21** 29**
22**********************************************************************/ 30**********************************************************************/
23#include <qgfx_qws.h> 31#include <qgfx_qws.h>
diff --git a/noncore/games/solitaire/harpcardgame.h b/noncore/games/solitaire/harpcardgame.h
index d1733fd..18b95e3 100644
--- a/noncore/games/solitaire/harpcardgame.h
+++ b/noncore/games/solitaire/harpcardgame.h
@@ -16,6 +16,16 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**
20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22** use 2 decks = 104 cards
23** deal 8 rows with one open card in the first place
24 **one hidden and one open in the second place and so on
25** append red to black and vice versa
26** each card can be layed on a free place
27** deal 8 cards at once
28**
19**********************************************************************/ 29**********************************************************************/
20#ifndef HARP_CARD_GAME_H 30#ifndef HARP_CARD_GAME_H
21#define HARP_CARD_GAME_H 31#define HARP_CARD_GAME_H
@@ -50,8 +60,8 @@ public:
50 60
51 virtual bool isAllowedOnTop(Card *card) { 61 virtual bool isAllowedOnTop(Card *card) {
52 if ( card->isFacing() && 62 if ( card->isFacing() &&
53 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // diese Zeile sorgt dafür dass nur Kings auf leere Plätze dürfen 63 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // only kings are allowed on empty places
54 ( (cardOnTop() == NULL) || // auf einen Freiplatz darf alles! 64 ( (cardOnTop() == NULL) || // aeach card can use an emply place
55 ( (cardOnTop() != NULL) && 65 ( (cardOnTop() != NULL) &&
56 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) && 66 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) &&
57 (card->isRed() != cardOnTop()->isRed()) ) ) ) 67 (card->isRed() != cardOnTop()->isRed()) ) ) )
@@ -92,7 +102,7 @@ public:
92 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; 102 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
93 // correct the position taking in to account the card is not 103 // correct the position taking in to account the card is not
94 // yet flipped, but will become flipped 104 // yet flipped, but will become flipped
95 top = QPoint( top.x(), top.y() - 3 ); // Keine Verschiebung! 105 top = QPoint( top.x(), top.y() - 3 ); // no moving to the side
96 newTopCard->flipTo( top.x(), top.y() ); 106 newTopCard->flipTo( top.x(), top.y() );
97 top = QPoint( top.x(), top.y() + offsetDown ); 107 top = QPoint( top.x(), top.y() + offsetDown );
98 } 108 }
@@ -108,7 +118,7 @@ public:
108 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; 118 int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
109 y += offsetDown; 119 y += offsetDown;
110 } else { 120 } else {
111 x += 0; // Keine Verschiebung! 121 x += 0; // no moving to the side
112 y += 3; 122 y += 3;
113 } 123 }
114 card = cardInfront(card); 124 card = cardInfront(card);
diff --git a/noncore/games/solitaire/teeclubcardgame.cpp b/noncore/games/solitaire/teeclubcardgame.cpp
index e15da96..0941e0d 100644
--- a/noncore/games/solitaire/teeclubcardgame.cpp
+++ b/noncore/games/solitaire/teeclubcardgame.cpp
@@ -17,7 +17,15 @@
17** not clear to you. 17** not clear to you.
18** 18**
19** 19**
20** Modified by C.A.Mader 2002 20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22** use 2 decks = 104 cards
23** deal 9 rows with 5 open cards each
24** append one card to each other card which is one step higher
25** move only columns of cards which are equal in suit
26** each card can be layed on a free place
27** deal 1 card at once on the first pile
28**
21** 29**
22**********************************************************************/ 30**********************************************************************/
23#include <qgfx_qws.h> 31#include <qgfx_qws.h>
@@ -84,7 +92,7 @@ void TeeclubCardGame::resizePiles()
84 beginDealing(); 92 beginDealing();
85 for (int i = 0; i < 9; i++) { 93 for (int i = 0; i < 9; i++) {
86 while ((workingPiles[i]->getCardPos(NULL).y() > 230) && (workingPiles[i]->getOffsetDown()>1)) { 94 while ((workingPiles[i]->getCardPos(NULL).y() > 230) && (workingPiles[i]->getOffsetDown()>1)) {
87 // Resizen des Stapels 95 // resize the pile
88 workingPiles[i]->setOffsetDown(workingPiles[i]->getOffsetDown()-1); 96 workingPiles[i]->setOffsetDown(workingPiles[i]->getOffsetDown()-1);
89 Card *card = workingPiles[i]->cardOnBottom(); 97 Card *card = workingPiles[i]->cardOnBottom();
90 int p=0; 98 int p=0;
diff --git a/noncore/games/solitaire/teeclubcardgame.h b/noncore/games/solitaire/teeclubcardgame.h
index 06d49f8..25cfaf9 100644
--- a/noncore/games/solitaire/teeclubcardgame.h
+++ b/noncore/games/solitaire/teeclubcardgame.h
@@ -16,6 +16,17 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**
20** created on base of patiencecardgame by cam (C.A.Mader) 2002
21** Rules for this game:
22** use 2 decks = 104 cards
23** deal 9 rows with 5 open cards each
24** append one card to each other card which is one step higher
25 **move only columns of cards which are equal in suit
26** each card can be layed on a free place
27** deal 1 card at once on the first pile
28**
29**
19**********************************************************************/ 30**********************************************************************/
20#ifndef TEECLUB_CARD_GAME_H 31#ifndef TEECLUB_CARD_GAME_H
21#define TEECLUB_CARD_GAME_H 32#define TEECLUB_CARD_GAME_H
@@ -49,7 +60,7 @@ public:
49 } 60 }
50 virtual bool isAllowedToBeMoved(Card *card) { 61 virtual bool isAllowedToBeMoved(Card *card) {
51 if (card->isFacing()) return FALSE; 62 if (card->isFacing()) return FALSE;
52 return FALSE; // die Toten ruhn 63 return FALSE; // the deads are sleeping forever
53 } 64 }
54}; 65};
55 66
@@ -62,10 +73,10 @@ public:
62 73
63 virtual bool isAllowedOnTop(Card *card) { 74 virtual bool isAllowedOnTop(Card *card) {
64 if ( card->isFacing() && 75 if ( card->isFacing() &&
65 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // diese Zeile sorgt dafür dass nur Kings auf leere Plätze dürfen 76 // ( ( ( cardOnTop() == NULL ) && (card->getValue() == king) ) || // use this if only Kings are allowed on empty places
66 ( (cardOnTop() == NULL) || // auf einen Freiplatz darf alles! 77 ( (cardOnTop() == NULL) || // each card can use an empty place
67 ( (cardOnTop() != NULL) && 78 ( (cardOnTop() != NULL) &&
68 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) // bei teeclub sind die farben zum Anlegen egal 79 ((int)card->getValue() + 1 == (int)cardOnTop()->getValue()) // you can append every color on every color
69 ) ) ) 80 ) ) )
70 return TRUE; 81 return TRUE;
71 return FALSE; 82 return FALSE;
@@ -105,7 +116,7 @@ public:
105 int offsetDown = newTopCard->getCardPile()->getOffsetDown(); 116 int offsetDown = newTopCard->getCardPile()->getOffsetDown();
106 // correct the position taking in to account the card is not 117 // correct the position taking in to account the card is not
107 // yet flipped, but will become flipped 118 // yet flipped, but will become flipped
108 top = QPoint( top.x(), top.y() - 3 ); // Keine seitliche Verschiebung! 119 top = QPoint( top.x(), top.y() - 3 ); // no moving to the side
109 newTopCard->flipTo( top.x(), top.y() ); 120 newTopCard->flipTo( top.x(), top.y() );
110 top = QPoint( top.x(), top.y() + offsetDown ); 121 top = QPoint( top.x(), top.y() + offsetDown );
111 } 122 }
@@ -114,7 +125,7 @@ public:
114 } 125 }
115 126
116 if ((getCardPos(NULL).y() < 230) && (getOffsetDown()<13)) { 127 if ((getCardPos(NULL).y() < 230) && (getOffsetDown()<13)) {
117 // Resizen des Stapels 128 // resize the pile
118 beginDealing(); 129 beginDealing();
119 setOffsetDown(getOffsetDown()+1); 130 setOffsetDown(getOffsetDown()+1);
120 Card *card = cardOnBottom(); 131 Card *card = cardOnBottom();
@@ -136,7 +147,7 @@ public:
136 int offsetDown = card->getCardPile()->getOffsetDown(); 147 int offsetDown = card->getCardPile()->getOffsetDown();
137 y += offsetDown; 148 y += offsetDown;
138 } else { 149 } else {
139 x += 0; // Keine seitliche Verschiebung! 150 x += 0; // no moving to the side
140 y += 3; 151 y += 3;
141 } 152 }
142 card = cardInfront(card); 153 card = cardInfront(card);
@@ -154,7 +165,7 @@ public:
154 setNextY( getCardPos(NULL).y() ); 165 setNextY( getCardPos(NULL).y() );
155 166
156 while (isPileResize() && (getCardPos(NULL).y() > 230) && (getOffsetDown()>1)) { 167 while (isPileResize() && (getCardPos(NULL).y() > 230) && (getOffsetDown()>1)) {
157 // Resizen des Stapels 168 // resize the pile
158 beginDealing(); 169 beginDealing();
159 setOffsetDown(getOffsetDown()-1); 170 setOffsetDown(getOffsetDown()-1);
160 Card *card = cardOnBottom(); 171 Card *card = cardOnBottom();