-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.h
46 lines (40 loc) · 977 Bytes
/
game.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
#ifndef GAME_H
#define GAME_H
#include <QGraphicsView>
#include <QWidget>
#include <QGraphicsScene>
#include <QMouseEvent>
#include "block.h"
#include "coordinate.h"
#include "board.h"
#include "shop.h"
#include <vector>
#include "executor.h"
#include <QTimer>
#include <QObject>
#include "timer.h"
#include "unit.h"
#include "enemy.h"
#include <QMessageBox>
class Timer;
class Game: public QGraphicsView{
public:
Game(QWidget* parent = 0);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void finish();
QGraphicsScene *scene;
friend class Timer;
private:
Block* block;
Coordinate* coordinate;
Shop* shop;
Timer* mytimer;
std::vector<Executor*> executors;
std::vector<Enemy*> enemys;
QGraphicsTextItem *defeated, *defend;
int quota_val, cost_val, defeated_val, defend_val;
std::map<QString,int> cost_mp;
};
#endif // GAME_H