-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.h
102 lines (69 loc) · 2.04 KB
/
controller.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <iostream>
#include "Model.h"
#include "mapview.h"
#include <QKeyEvent>
#include <iostream>
#include "modelview.h"
#include "textscene.h"
#include <cstdlib>
#include "pathfinding.h"
#include <QTimer>
class Controller: public QObject
{
public:
Controller(QString filename, unsigned int nrOfEnemies, unsigned int nrOfHealthpacks, float pRatio = 0.25f, float xRatio = 0.25f);
float check(int posX, int posY); //checks what happens if they move a certain direction
bool move(std::string direction);
bool attackEnemy(int i);
int checkEnemy(int posX, int posY);
int checkPotion(int posX, int posY);
void drinkPotion(int i);
void printProtagonistPosition();
void printProtagonistHealth();
void printProtagonistEnergy();
void printDimensions();
void printMap();
void printPositionEnemies();
void win(); //Shows to the player that they have won
void lose(); //Shows to the player that they have lost
void printView();
void printTextView();
Model *getModel() const;
void printEnemyType();
ModelView *getModelView() const;
void MoveXenemy();
void printXenemy();
void printType();
int checkPoisonous(int posX, int posY);
TextScene *getTextScene() const;
void updatePoisonLevel();
Pathfinding *getPathfinder() const;
void drawPath(std::vector<TileStruct> path);
void clearPath(std::vector<TileStruct> path);
void findPath(int startX, int startY, int endX, int endY);
int getClosestEnemy();
int getClosestPotion();
MapView *getMapView();
void setauto();
void setAutoplay(bool newAutoplay);
bool getAutoplay();
public slots:
void timeraction();
void setWeight(float weight);
void autoclicked();
private:
QTimer *timer;
Model *model;
ModelView *modelView;
MapView *mapView;
Pathfinding *pathfinder;
TextScene *textScene;
bool firstClick;
bool autoplay;
signals:
public slots:
private slots:
};
#endif // CONTROLLER_H