-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJob.cpp
97 lines (85 loc) · 1.99 KB
/
Job.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include"Job.h"
namespace job {
Job::Job() {
this->field = KindOfFields::WhiteCollar;
this->job = KindOfJobs::OfficeWorker;
this->iJob = new WhiteCollar();
}
Job::~Job() {
delete this->iJob;
}
void Job::setSwitchJob(IJobSwitch* iJob) {
this->iJob = iJob;
}
void Job::addRate(int value) {
if (this->rate + value < -1000)
this->rate = -1000;
else if (this->rate + value > 1000)
this->rate = 1000;
else
this->rate += value;
if (this->rate > 200) {
this->setKindOfFields(KindOfFields::WhiteCollar);
this->setKindOfJobs(KindOfJobs::OfficeWorker);
this->setSwitchJob(new WhiteCollar());
}
else if (this->rate < -200) {
this->setKindOfFields(KindOfFields::BlackGuard);
this->setKindOfJobs(KindOfJobs::Hitman);
this->setSwitchJob(new Merchant());
}
else {
this->setKindOfFields(KindOfFields::Merchant);
this->setKindOfJobs(KindOfJobs::Farmer);
this->setSwitchJob(new BlackGuard());
}
}
void Job::setRate(int rate) {
this->rate = rate;
}
void Job::setKindOfFields(KindOfFields field) {
this->field = field;
}
void Job::setKindOfJobs(KindOfJobs job) {
this->job = job;
}
KindOfFields Job::getKindOfFields() {
return this->field;
}
KindOfJobs Job::getKindOfJobs() {
return this->job;
}
int Job::getRate() {
return this->rate;
}
///////////////////////////////////////////
///////////////////////////////////////////
void WhiteCollar::addTax(float tax) {
this->tax.total += tax;
}
void WhiteCollar::clearTax() {
this->tax.total = 0.0f;
}
Tax WhiteCollar::getTax() {
return this->tax;
}
void WhiteCollar::setTaxRate(float rate) {
this->tax.rate = rate;
}
void WhiteCollar::quest() {
}
///////////////////////////////////////////
///////////////////////////////////////////
void Merchant::addTax(float tax) {
this->tax.total += tax;
}
void Merchant::clearTax() {
this->tax.total = 0.0f;
}
Tax Merchant::getTax() {
return this->tax;
}
void Merchant::setTaxRate(float rate) {
this->tax.rate = rate;
}
}