-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.cpp
More file actions
91 lines (80 loc) · 2.48 KB
/
User.cpp
File metadata and controls
91 lines (80 loc) · 2.48 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "User.h"
using namespace std;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Constructor takes in parameters for username and password. Other
* variables are set to default values.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
User::User(string name, string pw) {
nextUser = NULL;
userName = name;
password = pw;
highScore = 0;
//savedGame = NULL;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Destructor
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
User::~User() {
}
User * User::next() {
return nextUser;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* getUserName() : returns the userName.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
string User::getUserName() {
return userName;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* getPassword() : returns the password.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
string User::getPassword() {
return password;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* getHighScore() : returns the highscore.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int User::getHighScore() {
return highScore;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* setHighScore() : sets the highscore equal to the integer parameter 'hs'.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void User::setHighScore(int hs) {
highScore = hs;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* setNext() : sets the next user in the linked list equal to the User
* pointer parameter 'newUser'.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void User::setNext(User * newUser) {
nextUser = newUser;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* saveGame() : sets the savedGame equal to current gameboard to be stored.
* This should be called periodically, together with saveData() in
* AccountManager.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
void User::saveGame(Board * game) {
savedGame = game;
}*/
void User::printUser() {
//cout << userName << " " << highScore << " ";
}