-rw-r--r-- | noncore/games/solitaire/canvascardgame.cpp | 4 | ||||
-rw-r--r-- | noncore/games/solitaire/chicanecardgame.cpp | 8 | ||||
-rw-r--r-- | noncore/games/solitaire/chicanecardgame.h | 17 | ||||
-rw-r--r-- | noncore/games/solitaire/harpcardgame.cpp | 10 | ||||
-rw-r--r-- | noncore/games/solitaire/harpcardgame.h | 18 | ||||
-rw-r--r-- | noncore/games/solitaire/teeclubcardgame.cpp | 12 | ||||
-rw-r--r-- | noncore/games/solitaire/teeclubcardgame.h | 27 |
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 | |||
@@ -374,10 +374,10 @@ void CanvasCardGame::readPile( Config& cfg, CardPile *pile, QString name, int& h | |||
374 | bool facing = cfg.readBoolEntry( "CardFacing" + cardStr ); | 374 | bool facing = cfg.readBoolEntry( "CardFacing" + cardStr ); |
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(); |
383 | highestZ++; | 383 | highestZ++; |
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 | |||
@@ -16,9 +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 | ** | 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> |
24 | #include "chicanecardgame.h" | 30 | #include "chicanecardgame.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 | |||
@@ -15,8 +15,17 @@ | |||
15 | ** | 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 |
22 | 31 | ||
@@ -49,10 +58,10 @@ public: | |||
49 | PatienceWorkingPile(x, y, canvas) { } | 58 | PatienceWorkingPile(x, y, canvas) { } |
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()) ) ) ) |
58 | return TRUE; | 67 | return TRUE; |
@@ -91,9 +100,9 @@ public: | |||
91 | if ( newTopCard->isFacing() == FALSE ) { | 100 | if ( newTopCard->isFacing() == FALSE ) { |
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 | } |
99 | setNextX( top.x() ); | 108 | setNextX( top.x() ); |
@@ -107,9 +116,9 @@ public: | |||
107 | if (card->isFacing()) { | 116 | if (card->isFacing()) { |
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); |
115 | } | 124 | } |
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 | |||
@@ -16,9 +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 | ** | 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> |
24 | #include "harpcardgame.h" | 32 | #include "harpcardgame.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 | |||
@@ -15,8 +15,18 @@ | |||
15 | ** | 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 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 |
22 | 32 | ||
@@ -49,10 +59,10 @@ public: | |||
49 | PatienceWorkingPile(x, y, canvas) { } | 59 | PatienceWorkingPile(x, y, canvas) { } |
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()) ) ) ) |
58 | return TRUE; | 68 | return TRUE; |
@@ -91,9 +101,9 @@ public: | |||
91 | if ( newTopCard->isFacing() == FALSE ) { | 101 | if ( newTopCard->isFacing() == FALSE ) { |
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 | } |
99 | setNextX( top.x() ); | 109 | setNextX( top.x() ); |
@@ -107,9 +117,9 @@ public: | |||
107 | if (card->isFacing()) { | 117 | if (card->isFacing()) { |
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); |
115 | } | 125 | } |
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 | |||
@@ -16,9 +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 | ** | 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> |
24 | #include "teeclubcardgame.h" | 32 | #include "teeclubcardgame.h" |
@@ -83,9 +91,9 @@ void TeeclubCardGame::resizePiles() | |||
83 | { | 91 | { |
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; |
91 | while (card != NULL) { | 99 | while (card != NULL) { |
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 | |||
@@ -15,8 +15,19 @@ | |||
15 | ** | 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 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 |
22 | 33 | ||
@@ -48,9 +59,9 @@ public: | |||
48 | return FALSE; | 59 | return FALSE; |
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 | ||
56 | 67 | ||
@@ -61,12 +72,12 @@ public: | |||
61 | PatienceWorkingPile(x, y, canvas) { } | 72 | PatienceWorkingPile(x, y, canvas) { } |
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; |
72 | } | 83 | } |
@@ -104,18 +115,18 @@ public: | |||
104 | if ( newTopCard->isFacing() == FALSE ) { | 115 | if ( newTopCard->isFacing() == FALSE ) { |
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 | } |
112 | setNextX( top.x() ); | 123 | setNextX( top.x() ); |
113 | setNextY( top.y() ); | 124 | setNextY( top.y() ); |
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(); |
121 | int p=0; | 132 | int p=0; |
@@ -135,9 +146,9 @@ public: | |||
135 | if (card->isFacing()) { | 146 | if (card->isFacing()) { |
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); |
143 | } | 154 | } |
@@ -153,9 +164,9 @@ public: | |||
153 | setNextX( getCardPos(NULL).x() ); | 164 | setNextX( getCardPos(NULL).x() ); |
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(); |
161 | int p=0; | 172 | int p=0; |