00001 #ifndef DISPLAY_TWO_H
00002 #define DISPLAY_TWO_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <QGraphicsScene>
00025 #include <QPixmap>
00026 #include <QHash>
00027
00028
00029 #include <kdebug.h>
00030
00031
00032 #include "abstractdisplay.h"
00033 #include "thememanager.h"
00034 #include "deck.h"
00035 #include "player.h"
00036
00037
00038 class PixmapSprite;
00039 class ScoreSprite;
00040 class TextSprite;
00041
00042
00045 class DisplayTwo : public AbstractDisplay, public virtual Themable
00046 {
00047 Q_OBJECT
00048
00049 public:
00057 DisplayTwo(Deck* deck, QGraphicsScene* scene, ThemeManager* theme, int advancePeriod, QGraphicsView* parent);
00058
00061 void start();
00062
00066 virtual void changeTheme();
00067
00068
00069
00070
00071
00072 void deal(Player* player, int position);
00073
00080 void play(int cardNumber, int playerNumber, int phase);
00081
00086 void turn(int cardNumber);
00087
00093 void remove(int winnerPosition, int cardNumber, int delta);
00094
00099 int shuffleTime();
00100
00105 void showScore(int position, int score);
00106
00110 void showText(QString text);
00111
00115 void showMove(int no = -1);
00116
00117 public slots:
00125 void convertMousePress(QPoint mouse, int& playerNumber, int& cardNumber);
00126
00131 void updatePlayer(Player* player);
00132
00133 protected:
00139 void calcXYFromNumber(int cardNumber, int& x, int& y);
00140
00145 CardSprite* getCardSprite(int cardValue);
00146
00147 private:
00148
00149 QPixmap* mMovePixmap;
00150
00151 QHash<int,PixmapSprite*> mMoveSprites;
00152
00153 ScoreSprite* mScoreBoard[2];
00154
00155 PixmapSprite* mCardArea[2];
00156
00157 PixmapSprite* mPlayArea;
00158
00159 TextSprite* mText[3];
00160 };
00161
00162 #endif