-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
63 lines (48 loc) · 1.24 KB
/
Player.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
#ifndef MYPLAYER_H
#define MYPLAYER_H
#include <QGraphicsPixmapItem>
#include <QSet>
#include "controlswindow.h"
#include "scenariobox.h"
#include "Room.h"
#include <vector>
#include "Map.h"
#include <unistd.h>
#define NUM_OF_ROOMS 45
using namespace std;
class Player: public QGraphicsPixmapItem{
public:
Player();
virtual ~Player();
Map *map;
QVector <QString> items;
Room *currentRoom;
int roomIndex;
Room *roomArray[NUM_OF_ROOMS];
ScenarioBox sbox;
ControlsWindow menu;
bool a;
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
virtual void init();
void keyPressEvent(QKeyEvent * event);
enum directions { UP = 1, DOWN, LEFT, RIGHT};
bool canMove(directions d);
void addItem(Item *x);
void getItems();
virtual void showMenu();
virtual void showScenarioBox();
virtual QString chasePlayerLEFTRIGHT(Player *p){(void) p; return "";}
virtual void checkCaught(Player *p){ (void) p; return;}
virtual QString chasePlayerUPDOWN(Player *p){ (void) p; return "";}
template<typename T>
void printClassArray(T *s)
{
for(int i = 0;i < NUM_OF_ROOMS; i ++){
qDebug() << (*s)[i];
}
}
};
#endif // MYPLAYER_H