forked from mayant15/AlmostPure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.cpp
58 lines (44 loc) · 947 Bytes
/
Event.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
#include "Event.h"
using namespace std;
Event::Event() {
fStats = 0;
mStats = 0;
}
Event::Event(string s, vector<string> op, int f, int m){
message = s;
fStats = f;
mStats = m;
options = op;
}
Event::Event(string s, int f, int m){
message = s;
fStats = f;
mStats = m;
}
void Event::trigger(){
cout << endl << message << endl;
if(nextEvent.empty()){
exit(0);
}
if(!options.empty()){
for(int i = 1; i <= options.size(); i++){
cout << i << ". " << options.at(i-1) << endl;
}
}
}
Event* Event::getNext(int n){
return nextEvent.at(n-1);
}
void Event::setNext(Event* e){
nextEvent.push_back(e);
}
void Event::setOptions(vector<string> op){
options = op;
}
void Event::setMessage(string m){
message = m;
}
void Event::updateStats(Dolphin& f, Dolphin& m){
f.love = f.love + fStats;
m.love = m.love + mStats;
}