-
Notifications
You must be signed in to change notification settings - Fork 0
/
abstractgameitem.h
47 lines (40 loc) · 1 KB
/
abstractgameitem.h
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
#ifndef ABSTRACTGAMEITEM_H
#define ABSTRACTGAMEITEM_H
#include "config.h"
#include "randommaker.h"
#include "pixmapsmaker.h"
#include <QVector>
#include <QWidget>
#include <QGraphicsObject>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QStyleOptionGraphicsItem>
#include <QPainter>
#include <QPainterPath>
#include <QRectF>
#include <QMouseEvent>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsSceneHoverEvent>
#include <QTimer>
class AbstractGameItem : public QGraphicsObject
{
Q_OBJECT
public:
AbstractGameItem(qreal w, qreal h,
QGraphicsScene *scene,
QGraphicsItem *parent = nullptr);
virtual ~AbstractGameItem(){}
virtual const QString & name() const = 0;
// the size of pixmap
qreal width() const;
qreal height() const;
protected:
// related to the animation control
uint m_step;
// size of the item
qreal m_w;
qreal m_h;
// index of the pixs
int m_pixIndex;
};
#endif // ABSTRACTGAMEITEM_H