-
Notifications
You must be signed in to change notification settings - Fork 0
/
tile.cc
59 lines (42 loc) · 876 Bytes
/
tile.cc
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
#include "tile.h"
using namespace std;
Tile::Tile(Posn p, char type) : p{p}, base{type}, type{type}, chamber{0} {
}
char Tile::getType() const {
return this->type;
}
void Tile::notifyLeave() {
this->type = '.'; // sets cell to empty
}
void Tile::notify(Subject *whoNotified) {
this->type = whoNotified->getIcon();
this->notifyObservers(SubscriptionType::Display);
}
/*
void Tile::notifyComing(char c) {
this->type = c;
this->notifyDisplay();
}
*/
SubscriptionType Tile::getSubType() const {
return SubscriptionType::Move;
}
Posn Tile::getCurPos() const {
return this->p;
}
Posn Tile::getLastPos() const {
return this->p;
}
char Tile::getIcon() const {
return this->type;
}
int Tile::getChamber() const {
return chamber;
}
void Tile::setChamber(int cham) {
chamber = cham;
}
Posn Tile::getPosn() const {
return p;
}
Tile::~Tile(){}