This repository has been archived by the owner on Dec 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapviewpage.h
85 lines (69 loc) · 1.99 KB
/
mapviewpage.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef MAPVIEWPAGE_H
#define MAPVIEWPAGE_H
#include <QDialog>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsItem>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QGraphicsPixmapItem>
#include "NewWeapon/weaponmanager.h"
#include "GameCharacter/charactermanager.h"
#include <QTimer>
#include "GameScene/camera.h"
namespace Ui {
class MapViewPage;
}
class MapViewPage : public QDialog
{
Q_OBJECT
public:
explicit MapViewPage(const QString& mapImgPath, const QString& mapConfigPath, int numMelee, int numRanged, int bulletSpeed, QWidget *parent = nullptr);
~MapViewPage();
void setMapPath(QString inputPath);
private:
Ui::MapViewPage *ui;
int numMelee;
int numRanged;
int bulletSpeed;
QTimer timer;
Character::Controller controller;
QString mapPath;
Character* mainCharacter;
Camera* cameraController;
Character::Controller* characterController;
/**
* @brief initializeManager initialize the managers;
*/
void initializeManager();
CharacterManager* characterManager;
WeaponManager* weaponManager;
/**
* @brief initializeItemFrame Intialize the item frame
* @param c character to listen
*/
void initializeItemFrame(Character* c);
/**
* @brief putWeapon Put the weapon on the ground
* @param weapon weapon to put
* @param x Grid X coordinate
* @param y Grid Y coordinate
*/
void putWeapon(Weapon* weapon, int x, int y);
/**
* @brief generateEnemy generate the enemy which chases the character
*/
Enemy* generateEnemy() const;
QPoint generateRandomMapPos() const;
public:
CharacterManager* get_character_manager();
void onMouseEvent(const QString& eName, const QPoint& p);
void keyPressEvent(QKeyEvent*) override;
void keyReleaseEvent(QKeyEvent*) override;
signals:
void emitKeyboardPressed();
private slots:
void on_generateEnemyButton_clicked();
void on_closeButton_clicked();
};
#endif // MAPVIEWPAGE_H