-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.cpp
56 lines (43 loc) · 999 Bytes
/
player.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
//
// player.cpp
// bug-cup-draw
//
// Created by Eduardo Castro on 22/12/21.
//
#ifndef PLAYER_CPP
#define PLAYER_CPP
#include <iostream>
#include <sstream>
using namespace std;
class Player {
private:
string name;
int star;
public:
Player(string name, int star){
setName(name);
setStar(star);
}
void setName(string name){
this->name = name;
}
void setStar(int star){
this->star = star;
}
string getName(){
return this->name;
}
int getStar(){
return this->star;
}
void toString(){
stringstream data;
data << "\n Name: " << getName() << " Level: ";
for(int i = 0; i < star; i++){
data << "*";
}
data << endl;
cout<<data.str();
}
};
#endif