summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/card.cpp
blob: 609e28029ff12f91211e02cd7be4ce36033de22f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**********************************************************************
** Copyright (C) 2000 Trolltech AS.  All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#include "card.h"

#include <qpe/config.h>

#include <qpoint.h>
#include <qlist.h>

/*
Card( eValue v, eSuit s, bool f ) :
    val(v), suit(s), faceUp(f), showing(FALSE), ix(0), iy(0), iz(0), cardPile(NULL) { }
virtual ~Card() { }
eValue getValue() { return val; }
eSuit getSuit() { return suit; }
CardPile *getCardPile() { return cardPile; }
bool isFacing() { return faceUp; }
bool isShowing() { return showing; }
bool isRed() { return ((suit == diamonds) || (suit == hearts)); }
int getX(void) { return ix; }
int getY(void) { return iy; }
int getZ(void) { return iz; }
void setCardPile(CardPile *p) { cardPile = p; }
void setFace(bool f) { faceUp = f; }
void flip(void) { flipTo(getX(), getY()); }
virtual void setPos(int x, int y, int z) { ix = x; iy = y; iz = z; }
virtual void move(int x, int y) { ix = x; iy = y; }
virtual void move(QPoint p) { ix = p.x(); iy = p.y(); }
virtual void flipTo(int x, int y, int steps = 8) { ix = x; iy = y; faceUp = !faceUp; redraw(); Q_UNUSED(steps); }
virtual void showCard(void) { showing = TRUE; }
virtual void hideCard(void) { showing = FALSE; }
virtual void redraw(void) { }
*/