-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPokemon.cpp
More file actions
173 lines (137 loc) · 3.51 KB
/
Copy pathPokemon.cpp
File metadata and controls
173 lines (137 loc) · 3.51 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//
// Created by Andrea Halenkamp on 12/14/16.
//
#include "Pokemon.h"
bool Pokemon::compareTypes(string type1, string type2) {
if (types.size()>1) {
bool compare = true;
for (auto i = types.begin(); i != types.end(); ++i) {
if (*i != type1 && *i != type2) {
compare = false;
}
}
return compare;
} else return false;
}
bool Pokemon::compareType(string type) {
if (types.size()<2) {
bool compare = true;
for (auto i = types.begin(); i != types.end(); ++i) {
if (*i != type) {
compare = false;
}
}
return compare;
} else return false;
}
void Pokemon::addType(string t) {
types.push_back(t);
}
void Pokemon::printTypes()const {
cout << "Types: ";
for (auto i = types.begin(); i != types.end(); ++i)
cout << *i << ' ';
}
void Pokemon::setbase_hp(int h) {
base_stats[0] = h;
}
void Pokemon::setbase_attack(int a) {
base_stats[1] = a;
}
void Pokemon::setbase_defense(int d) {
base_stats[2] = d;
}
void Pokemon::setbase_specialattack(int sa) {
base_stats[3] = sa;
}
void Pokemon::setbase_specialdefense(int sd) {
base_stats[4] = sd;
}
void Pokemon::setbase_speed(int s) {
base_stats[5] = s;
}
int Pokemon::getbase_hp()const {
return base_stats[0];
}
int Pokemon::getbase_attack()const {
return base_stats[1];
}
int Pokemon::getbase_defense()const {
return base_stats[2];
}
int Pokemon::getbase_specialattack()const {
return base_stats[3];
}
int Pokemon::getbase_specialdefense()const {
return base_stats[4];
}
int Pokemon::getbase_speed()const {
return base_stats[5];
}
void Pokemon::addAbility(string a) {
abilities.push_back(a);
}
void Pokemon::printbase_stats() const {
cout << "\nStatistics:"
<< "\n\tHP: " << base_stats[0]
<< "\n\tAttack: " << base_stats[1]
<< "\n\tDefense: " << base_stats[2]
<< "\n\tSpecial-Attack: " << base_stats[3]
<< "\n\tSpecial-Defense: " << base_stats[4]
<< "\n\tSpeed: " << base_stats[5] << endl;
}
void Pokemon::printAbilities() const {
cout << "Abilities: ";
for (auto i = abilities.begin(); i != abilities.end(); ++i)
cout << *i << ' ';
}
const void Pokemon::print() const {
cout << "Pokemon Name: " << name
<< ", ID: " << id << ", ";
printTypes();
printbase_stats();
printAbilities();
if (!description.empty())
cout << "\n" << description;
cout << "\nGender Ratio: "
<< gender_rate << "/8\n" << endl;
}
const string &Pokemon::getName() const {
return name;
}
void Pokemon::setName(const string &name) {
Pokemon::name = name;
}
const int Pokemon::getId() const {
return id;
}
void Pokemon::setId(const int id) {
Pokemon::id = id;
}
const vector<string> Pokemon::getTypes() const {
return types;
}
void Pokemon::setTypes(const vector<string> &types) {
Pokemon::types = types;
}
const int *Pokemon::getBase_stats() const {
return base_stats;
}
const vector<string> &Pokemon::getAbilities() const {
return abilities;
}
void Pokemon::setAbilities(const vector<string> &abilities) {
Pokemon::abilities = abilities;
}
int Pokemon::getGender_rate() const {
return gender_rate;
}
void Pokemon::setGender_rate(int gender_rate) {
Pokemon::gender_rate = gender_rate;
}
const string &Pokemon::getDescription() const {
return description;
}
void Pokemon::setDescription(const string &description) {
Pokemon::description = description;
}