-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoom.cpp
76 lines (59 loc) · 1.2 KB
/
Room.cpp
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
#include "Room.h"
#include "Item.h"
#include <QDebug>
Room::Room(QString description, int x1, int y1, int x2, int y2) {
X1 = x1;
X2 = x2;
Y1 = y1;
Y2 = y2;
this->description = description;
this->item = new Item("NONE");
this->hasScenario = false;
}
Room::Room(QString description, int x1, int y1, int x2, int y2, bool scenario) {
X1 = x1;
X2 = x2;
Y1 = y1;
Y2 = y2;
this->description = description;
this->item = new Item("NONE");
this->hasScenario = scenario;
}
Room::~Room(){
qDebug() << "Deleting room :- " << description;
delete item;
}
QString Room::longDescription() {
return description;
}
void Room::setItem(Item *inItem) {
item = inItem;
return;
}
Item* Room::getItem() {
return item;
}
void Room::removeItem(){
this->item->setDescription("NONE");
}
int Room::isItemInRoom(QString inString)
{
qDebug() << inString;
return 1;
}
int Room::getX1(){
return X1;
}
int Room::getY1(){
return Y1;
}
int Room::getX2(){
return X2;
}
int Room::getY2(){
return Y2;
}
void Room::scenarioDone()
{
this->hasScenario = false;
}