Represents the user especially his progress in map packs.
More...
#include <User.h>
|
| User (const std::string &p_name) |
| Constructor. More...
|
|
int | get_progress (const std::string &m_name) |
| Gets progres for map pack of user which is determined by his name. More...
|
|
void | set_progress (const std::string &m_name, int lvl) |
| Update progress for user and map pack if input parameter representing number of finished level is higher then current progress. More...
|
|
const std::string & | get_name () const |
| Gets name of the user which is represented by the instance of this class. More...
|
|
Represents the user especially his progress in map packs.
◆ User()
User::User |
( |
const std::string & |
p_name | ) |
|
|
inline |
Constructor.
Creates an instance from user's name.
- Parameters
-
◆ get_name()
const std::string& User::get_name |
( |
| ) |
const |
|
inline |
Gets name of the user which is represented by the instance of this class.
- Returns
- Name of the user.
◆ get_progress()
int User::get_progress |
( |
const std::string & |
m_name | ) |
|
|
inline |
Gets progres for map pack of user which is determined by his name.
- Returns
- Number of finished maps in map pack.
◆ set_progress()
void User::set_progress |
( |
const std::string & |
m_name, |
|
|
int |
lvl |
|
) |
| |
|
inline |
Update progress for user and map pack if input parameter representing number of finished level is higher then current progress.
- Parameters
-
m_name | Name of the map pack. |
lvl | Finished level. |
◆ operator<
bool operator< |
( |
const User & |
left_u, |
|
|
const User & |
right_u |
|
) |
| |
|
friend |
Operator <.
Compare two users according to their names.
- Parameters
-
left_u | Left operand. |
right_u | Right operand. |
- Returns
- Bool variable representing if left operand is less then the right.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
stream, |
|
|
const User & |
user |
|
) |
| |
|
friend |
Operator <<.
Writes information about user's progress.
- Parameters
-
stream | Output stream. |
user | User whose progress should be written. |
◆ operator==
bool operator== |
( |
const User & |
left_u, |
|
|
const User & |
right_u |
|
) |
| |
|
friend |
Operator ==.
- Parameters
-
left_u | Left operand. |
right_u | Right operand. |
- Returns
- Bool variable representing if left operand is qeual to the right.
◆ name
◆ progress
std::map<std::string, int> User::progress |
|
private |
map of "map pack name" and user's progress in this pack
The documentation for this class was generated from the following file: