-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.cpp
57 lines (50 loc) · 1.16 KB
/
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
57
#include "player.h"
// Constructor: Khởi tạo người chơi
Player::Player(const std::string& playerName, char playerSymbol)
: name(playerName), symbol(playerSymbol) {}
Player::Player(){
totalMatches = 0;
NumofDraws = 0;
NumOfLosses = 0;
NumOfWins = 0;
}
// Lấy tên người chơi
std::string Player::getName() const {
return name;
}
// Lấy ký hiệu của người chơi
char Player::getSymbol() const {
return symbol;
}
// Cập nhật tên người chơi
void Player::setName(const std::string& playerName) {
name = playerName;
}
// Cập nhật ký hiệu của người chơi
void Player::setSymbol(char playerSymbol) {
symbol = playerSymbol;
}
void Player::setNumofWins(int x){
NumOfWins = x;
}
void Player::setNumofLosses(int x){
NumOfLosses = x;
}
void Player::setNumofDraws(int x){
NumofDraws = x;
}
void Player::setTotalmatches(int x){
totalMatches = x;
}
int Player::getTotalMatches() const {
return totalMatches;
}
int Player::getNumOfWins() const {
return NumOfWins;
}
int Player::getNumofLosses() const {
return NumOfLosses;
}
int Player::getNumofDraws() const {
return NumofDraws;
}