Diffstat (limited to 'noncore/games/solitaire/card.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/card.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/games/solitaire/card.cpp b/noncore/games/solitaire/card.cpp new file mode 100644 index 0000000..609e280 --- a/dev/null +++ b/noncore/games/solitaire/card.cpp | |||
@@ -0,0 +1,53 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "card.h" | ||
22 | |||
23 | #include <qpe/config.h> | ||
24 | |||
25 | #include <qpoint.h> | ||
26 | #include <qlist.h> | ||
27 | |||
28 | /* | ||
29 | Card( eValue v, eSuit s, bool f ) : | ||
30 | val(v), suit(s), faceUp(f), showing(FALSE), ix(0), iy(0), iz(0), cardPile(NULL) { } | ||
31 | virtual ~Card() { } | ||
32 | eValue getValue() { return val; } | ||
33 | eSuit getSuit() { return suit; } | ||
34 | CardPile *getCardPile() { return cardPile; } | ||
35 | bool isFacing() { return faceUp; } | ||
36 | bool isShowing() { return showing; } | ||
37 | bool isRed() { return ((suit == diamonds) || (suit == hearts)); } | ||
38 | int getX(void) { return ix; } | ||
39 | int getY(void) { return iy; } | ||
40 | int getZ(void) { return iz; } | ||
41 | void setCardPile(CardPile *p) { cardPile = p; } | ||
42 | void setFace(bool f) { faceUp = f; } | ||
43 | void flip(void) { flipTo(getX(), getY()); } | ||
44 | virtual void setPos(int x, int y, int z) { ix = x; iy = y; iz = z; } | ||
45 | virtual void move(int x, int y) { ix = x; iy = y; } | ||
46 | virtual void move(QPoint p) { ix = p.x(); iy = p.y(); } | ||
47 | virtual void flipTo(int x, int y, int steps = 8) { ix = x; iy = y; faceUp = !faceUp; redraw(); Q_UNUSED(steps); } | ||
48 | virtual void showCard(void) { showing = TRUE; } | ||
49 | virtual void hideCard(void) { showing = FALSE; } | ||
50 | virtual void redraw(void) { } | ||
51 | */ | ||
52 | |||
53 | |||