-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
50 lines (34 loc) · 1.08 KB
/
player.h
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
#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED
#include <string>
#include <vector>
class Player {
private:
std::string name; // Tên người chơi
char symbol; // Ký hiệu của người chơi (X hoặc O)
int totalMatches; //tổng số trận
int NumOfWins; // số trận thắng
int NumOfLosses;
int NumofDraws;
public:
// Constructor
Player(const std::string& playerName, char playerSymbol);
Player();
// Getter: Lấy tên người chơi
std::string getName() const;
// Getter: Lấy ký hiệu của người chơi
char getSymbol() const;
// Setter: Cập nhật tên người chơi
void setName(const std::string& playerName);
// Setter: Cập nhật ký hiệu của người chơi
void setSymbol(char playerSymbol);
void setNumofWins(int x);
void setNumofLosses(int x);
void setNumofDraws(int x);
void setTotalmatches(int x);
int getTotalMatches() const;
int getNumOfWins() const;
int getNumofLosses() const;
int getNumofDraws() const;
};
#endif // PLAYER_H_INCLUDED