00001 #ifndef DECK_H
00002 #define DECK_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <QObject>
00025 #include <QList>
00026 #include <QPixmap>
00027 #include <QSize>
00028 #include <QHash>
00029
00030
00031 #include <kdebug.h>
00032 #include <krandomsequence.h>
00033
00034
00037 namespace CardDeck
00038 {
00039
00040 enum Suite {Club=0,Spade=1,Heart=2,Diamond=3,Grand=4};
00041
00042 enum CardType {Ace=0,King=1,Queen=2,Jack=3,Ten=4,Nine=5,Eight=6,Seven=7};
00043 }
00044
00045 using namespace CardDeck;
00046
00050 class Deck : public QObject
00051 {
00052 Q_OBJECT
00053
00054 public:
00055
00060 Deck(long seed, QObject* parent);
00061
00064 virtual ~Deck();
00065
00069 int cardNumber();
00070
00073 void shuffle();
00074
00081 Suite randomTrump();
00082
00086 int drawCard();
00087
00092 static Suite getSuite(int card);
00093
00098 static CardType getCardType(int card);
00099
00104 static int getCardValue(int card);
00105
00111 static QString name(Suite suite, CardType type);
00112
00117 static QString name(int card);
00118
00119 private:
00120
00121 QList<int> mCards;
00122
00123 KRandomSequence mRandom;
00124 };
00125
00126 #endif