-
Notifications
You must be signed in to change notification settings - Fork 0
/
pokemon1.cpp
113 lines (100 loc) · 2.52 KB
/
pokemon1.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include "pch.h"
#include "pokemon1.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
pokemon1::pokemon1()
{
}
pokemon1::~pokemon1()
{
}
pokemon1::pokemon1(std::string nameV) {
name = nameV;
health = 0;
attack = 0;
defense = 0;
speed = 0;
special_attack = 0;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV) {
name = nameV;
health = healthV;
attack = 0;
defense = 0;
speed = 0;
special_attack = 0;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV, int attackV) {
name = nameV;
health = healthV;
attack = attackV;
defense = 0;
speed = 0;
special_attack = 0;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV, int attackV, int defense_V) {
name = nameV;
health = healthV;
attack = attackV;
defense = defense_V;
speed = 0;
special_attack = 0;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV, int attackV, int defense_V, int speed_V) {
name = nameV;
health = healthV;
attack = attackV;
defense = defense_V;
speed = speed_V;
special_attack = 0;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV, int attackV, int defense_V, int speed_V, int special_attackV) {
name = nameV;
health = healthV;
attack = attackV;
defense = defense_V;
speed = speed_V;
special_attack = special_attackV;
special_defense = 0;
}
pokemon1::pokemon1(std::string nameV, int healthV, int attackV, int defense_V, int speed_V, int special_attackV, int special_defenseV) {
name = nameV;
health = healthV;
attack = attackV;
defense = defense_V;
speed = speed_V;
special_attack = special_attackV;
special_defense = special_defenseV;
}
void pokemon1::setSpecialAttack(int special_attackV) {
special_attack = special_attackV;
}
void pokemon1::setSpecialDefense(int special_defenseV) {
special_defense = special_defenseV;
}
void pokemon1::printFile()
{
string name;
name = getName();
ofstream fout("Pokemons.yml", ios::app);
fout << "- pokemon_one: " << "\n";
if (!name.empty())
{
fout << " name: " << name << "\n";
}
else fout << "no name" << "\n";
fout << " health: " << getHealth() << "\n";
fout << " attack: " << getAttack() << "\n";
fout << " defence: " << getDefense() << "\n";
fout << " speed: " << getSpeed() << "\n";
fout << " special attack: " << getSpecialAttack() << "\n";
fout << " special defence: " << getSpecialDefense() << "\n\n";
fout.close();
}