-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathGame.h
More file actions
43 lines (34 loc) · 1005 Bytes
/
Game.h
File metadata and controls
43 lines (34 loc) · 1005 Bytes
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
#ifndef GAME_H
#define GAME_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include "PathingMap.h"
#include "Player.h"
#include <vector>
#include "Enemy.h"
class Game: public QGraphicsView {
Q_OBJECT
public:
// constructors
Game( int numCellsWide, int numCellsLong,
int cellSize, QWidget* parent=nullptr);
// modifiers ("setters")
void createEnemy( int x, int y);
void fill( int x, int y);
bool filled(int x, int y);
// helper functions (readers)
Node pointToNode(const QPointF& point);
QPointF nodeToPoint(const Node& node);
public slots:
void setEnemyPathsToPlayer();
private:
// main private attributes
PathingMap pathingMap_; // pathing map
QGraphicsScene* scene_; // scene
Player* player_; // player
std::vector<Enemy*> enemies_; // enemies
int cellSize_; // cell size
// helper functions
void drawMap(const std::vector<std::vector<int>>& vec);
};
#endif // GAME_H