-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow1.h
More file actions
59 lines (44 loc) · 1.33 KB
/
window1.h
File metadata and controls
59 lines (44 loc) · 1.33 KB
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 WINDOW1_H
#define WINDOW1_H
#include <QMainWindow>
#include <QPaintEvent>
#include <QList>
#include <QFile>
#include <QTextStream>
#include <QMovie>
#include "plant.h"
#include "position.h"
#include "waypoint.h"
#include "enemy.h"
class Window1 : public QMainWindow
{
Q_OBJECT
public:
explicit Window1(QWidget *parent = nullptr);
void paintEvent(QPaintEvent *);//重绘事件处理函数的声明
void mousePressEvent(QMouseEvent *);
void getHpDamage(int damage = 1);
void removedEnemy(Enemy *enemy);
void doGameOver();
private slots:
void updateMap();
void gameStart();
private:
QList<Plant*> m_towerslist;
QList<Position> m_towerPositionsList;
void loadTowerPositions();
bool canBuyTower() const;
QList<WayPoint *> m_wayPointsList;
void addWayPoints();
QList<Enemy *> m_enemyList;//敌人列表
int m_playerHp;//玩家血量
int m_playrGold;//玩家金币数
int m_waves;//当前波数
bool loadWave();//加载下一波敌人的数目和出现时间
bool m_gameWin;
bool m_gameEnded;
QList<QVariant> m_wavesInfo;//最大波数
signals:
void chooseBack();
};
#endif // WINDOW1_H