-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodelview.h
80 lines (65 loc) · 1.96 KB
/
modelview.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
#ifndef MODELVIEW_H
#define MODELVIEW_H
#include <iostream>
#include "Model.h"
#include "qgraphicsview.h"
#include "protagonistview.h"
#include "Xenemy.h"
#include "Xenemyview.h"
#include "potionview.h"
#include "pathfinding.h"
#include "ui_mainwindow.h"
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsRectItem>
#include <QGraphicsSceneMouseEvent>
#include <QObject>
#include <QTimer>
class Controller;
class ModelView : public QGraphicsScene
{
Q_OBJECT;
public:
ModelView(int tileSize, Model *model, QString filename, Controller *controller);
void showMap(const Model *model);
void showProtagonist(Controller *controller);
void updateProtagonist();
void updateDirection(int direction);
void showMapSegment();
void showGVMap(QString filename);
int getXMin(int x_pro);
int getXMax(int x_pro);
int getYMin(int y_pro);
int getYMax(int y_pro);
QGraphicsScene *getScene() const;
void setScene(QGraphicsScene *newScene);
void zoom(QWheelEvent * event);
void showPotions(const Model *model);
void showPotions();
void removeRectItem(Model *model, std::string type);
void setUI(Ui::MainWindow *newUI);
void showXEnemies();
void showPoisonousTiles(const Model *model);
void updateXenemies(Model *model);
ProtagonistView *getProtagonist() const;
void updatePotions(Model *model);
void showNormalEnemies();
void showPEnemies();
ProtagonistView *getProtagonist();
int getTileSize() const;
void drawPath(std::vector<TileStruct> path);
void clearPath(std::vector<TileStruct> path);
void attack();
const std::vector<potiontileView *> &getPotionviews() const;
private:
ProtagonistView *Prot;
std::vector<bool> isDrawn;
int tileSize;
int maxRow;
int maxCol;
Model *model;
std::vector<XEnemyView*> xenemieviews;
std::vector<QGraphicsRectItem*> pathviews;
std::vector<potiontileView*> potionviews;
};
#endif // MODELVIEW_H