-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabtenn0.h
More file actions
43 lines (34 loc) · 1009 Bytes
/
tabtenn0.h
File metadata and controls
43 lines (34 loc) · 1009 Bytes
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
//
// Created by ruanying on 19-1-1.
//
#ifndef MYCPPNOTE_TABTENN0_H
#define MYCPPNOTE_TABTENN0_H
#include <string>
using namespace std;
// simple base class
class TableTennisPlayer{
private:
string firstname;
string lastname;
bool hasTable;
public:
TableTennisPlayer(const string & fn = "none",
const string & ln = "none",
bool ht = false);
void Name() const;
bool HasTable() const { return hasTable; }
void ResetTable(bool v) { hasTable = v; }
};
class RatedPlayer:public TableTennisPlayer{
private:
unsigned int rating; //add a data member
public:
RatedPlayer(unsigned int r = 0,
const string & fn = "none",
const string & ln = "none",
bool ht = false);
RatedPlayer(unsigned int r, const TableTennisPlayer & tp);
unsigned int Rating() const { return rating; } //add a method
void ResetRating(unsigned int r) { rating = r; }
};
#endif //MYCPPNOTE_TABTENN0_H