00001 #ifndef DISPLAY_GAME_H
00002 #define DISPLAY_GAME_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <QWidget>
00025 #include <QGraphicsScene>
00026 #include <QGraphicsView>
00027 #include <QHash>
00028 #include <QList>
00029 #include <QTimer>
00030
00031
00032 #include "thememanager.h"
00033
00034
00035 class ThemeManager;
00036 class PieceSprite;
00037 class SpriteNotify;
00038 class PixmapSprite;
00039 class ScoreSprite;
00040
00044 class DisplayGame : public QObject, public virtual Themable
00045 {
00046 Q_OBJECT
00047
00048 public:
00055 DisplayGame(int advancePeriod, QGraphicsScene* scene, ThemeManager* theme, QGraphicsView* parent = 0);
00056
00059 ~DisplayGame();
00060
00063 void start();
00064
00068 virtual void changeTheme();
00069
00079 SpriteNotify* displayPiece(int x,int y,int color,int no,bool animation);
00080
00085 void displayArrow(int x, int color);
00086
00093 void displayHint(int x, int y, bool show);
00094
00101 void displayStar(int x,int y,int no);
00102
00108 int mapMouseToMove(QPoint pos);
00109
00112 void displayEnd();
00113
00117 ScoreSprite* score();
00118
00119 protected slots:
00122 void advance();
00123
00124
00125 private:
00126
00127 ThemeManager* mTheme;
00128
00129
00130 QGraphicsScene* mScene;
00131
00132
00133 QGraphicsView* mView;
00134
00135
00136 int mAdvancePeriod;
00137
00138
00139 QList<QGraphicsItem*> mSprites;
00140
00141
00142 QList<PieceSprite*> mPieces;
00143
00144
00145 PixmapSprite* mBoard;
00146
00147
00148 QList<PixmapSprite*> mBoardHoles;
00149
00150
00151 QList<PixmapSprite*> mArrows;
00152
00153
00154 ScoreSprite* mScoreBoard;
00155
00156
00157 QList<PixmapSprite*> mStars;
00158
00159
00160 PixmapSprite* mHint;
00161
00162
00163 PixmapSprite* mGameOver;
00164
00165
00166 QTimer* mTimer;
00167 };
00168
00169 #endif