-
Notifications
You must be signed in to change notification settings - Fork 0
/
subject.cc
52 lines (40 loc) · 856 Bytes
/
subject.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
#include "subject.h"
void Subject::attach(const Posn &p, Observer *o) {
this->tileObservers[p] = o;
}
void Subject::attach(Observer *o) {
this->otherObservers.push_back(o);
}
void Subject::notifyObservers(SubscriptionType t) {
for (auto &i : tileObservers) {
if (t == i.second->getSubType()) i.second->notify(this);
}
for (auto &i : otherObservers) {
if (t == i->getSubType()) i->notify(this);
}
}
/*
void Subject::notifyDisplay() {
this->display->notifyComing(this);
}
*/
Stats Subject::getStats() const {
Stats ret{-1,0,0,0,0,"",""};
return ret;
}
void Subject::setAction(const std::string &s) {
return;
}
void Subject::appendAction(const std::string &s) {
return;
}
Subject::~Subject(){}
void Subject::use(Subject &p) {
return;
}
int Subject::getGold() const {
return 0;
}
void Subject::pickUpGold(int newGold) {
return;
}