00001 #ifndef PIECE_SPRITE_H
00002 #define PIECE_SPRITE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <QPointF>
00025 #include <QSizeF>
00026 #include <QGraphicsPixmapItem>
00027
00028
00029 #include "thememanager.h"
00030 #include "pixmapsprite.h"
00031 #include "spritenotify.h"
00032
00033
00037 class PieceSprite : public PixmapSprite
00038 {
00039
00040 public:
00043 PieceSprite(QString id, ThemeManager* theme, int advancePeriod, int no, QGraphicsScene* canvas);
00044
00047 ~PieceSprite();
00048
00051 enum MovementState {Idle, LinearMove};
00052
00056 virtual void advance(int phase);
00057
00061 virtual int type() const {return QGraphicsItem::UserType+2;}
00062
00066 virtual void changeTheme();
00067
00072 SpriteNotify* notify() {return mNotify;}
00073
00079 void startLinear(QPointF end, double velocity);
00080
00087 void startLinear(QPointF start, QPointF end, double velocity);
00088
00089 private:
00090
00091
00092 double mDuration;
00093
00094
00095 MovementState mMovementState;
00096
00097
00098 QPointF mEnd;
00099
00100
00101 SpriteNotify* mNotify;
00102
00103 };
00104
00105 #endif