-
Notifications
You must be signed in to change notification settings - Fork 2
/
scene.h
59 lines (51 loc) · 1.25 KB
/
scene.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
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef SCENE_H
#define SCENE_H
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QList>
#include "plant.h"
#include "target.h"
#include "cob.h"
#include "mower.h"
QT_BEGIN_NAMESPACE
class QMouseEvent;
QT_END_NAMESPACE
class Scene : public QGraphicsScene
{
Q_OBJECT
public:
explicit Scene(QObject *parent = 0);
signals:
void explodeAt(int row, int col);
void pauseAll();
void restoreAll();
void sentCob();
void clearLine(int row);
void sendHit(Zombie*, int,int);
public slots:
void restart();
void pause();
void restore();
void sendCob(QPoint &point);
void setNewPlant(Plant* p);
void alreadyPlanted();
void prepareForCob(Plant *p);
void receiveCob(Cob *cob);
void addMower(int row);
void destroyMower(Mower* m);
private slots:
void clearImpact();
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
bool prepare;
bool prepare4Cob;
Plant* newPlant;
Target* target;
const QPoint plantPos(const QPointF &p) const;
const QPoint targetPos(const QPointF &p) const;
Plant* pp;
QList<QGraphicsPixmapItem*> list;
bool paused;
};
#endif // SCENE_H