diff options
Diffstat (limited to 'highscore.h')
-rw-r--r-- | highscore.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/highscore.h b/highscore.h index f7ecacc..a3e531b 100644 --- a/highscore.h +++ b/highscore.h | |||
@@ -1,18 +1,23 @@ | |||
1 | #ifndef HIGHSCORE_H | 1 | #ifndef HIGHSCORE_H |
2 | #define HIGHSCORE_H | 2 | #define HIGHSCORE_H |
3 | 3 | ||
4 | #include <string> | ||
5 | |||
4 | class Highscore { | 6 | class Highscore { |
5 | public: | 7 | public: |
6 | Highscore(char* name, int level); | 8 | Highscore() = default; |
7 | char* getName(); | 9 | |
8 | int getLevel(); | 10 | Highscore(std::string name, int level) : name_(name), level_(level) {} |
9 | void setRank(int rank); | 11 | |
10 | int getRank(); | 12 | const std::string getName() const { return name_; } |
13 | int getLevel() const { return level_; } | ||
14 | void setRank(int rank) { rank_ = rank; } | ||
15 | int getRank() const { return rank_; } | ||
11 | 16 | ||
12 | private: | 17 | private: |
13 | char* name; | 18 | std::string name_; |
14 | int level; | 19 | int level_; |
15 | int rank; | 20 | int rank_; |
16 | }; | 21 | }; |
17 | 22 | ||
18 | #endif | 23 | #endif |