Record of how far a player has progressed through the game. Used to save/load to/from file.
More...
#include <PlayerProfile.hpp>
|
|
| PlayerProfile (std::string const &xmlPath) |
| | Constructs a PlayerProfile from an xml file. If the file does not exist, a new one will be created.
|
| |
| bool | hasUnlockedLevel (std::string const &levelPath) |
| | Find out if the player has unlocked a level. More...
|
| |
| void | unlockLevel (std::string const &levelPath) |
| | Unlocks a level for this profile. More...
|
| |
|
std::string const & | getName () const |
| | Returns the name of the player.
|
| |
| bool | save () const |
| | Saves the profile to its file. More...
|
| |
|
|
static void | createProfileFile (std::string const &path) |
| | Creates a new profile file with the first level unlocked. zparam path Path to where the file should be created, including file name and extension.
|
| |
|
static void | printError (std::string const &preMsg, errno_t error) |
| |
|
|
std::set< std::string > | mUnlockedLevelPaths |
| | Every level path contained in the set is considered unlocked for this profile.
|
| |
|
std::string | mName |
| | Name of the player.
|
| |
|
const std::string | mPath |
| |
Record of how far a player has progressed through the game. Used to save/load to/from file.
| bool PlayerProfile::hasUnlockedLevel |
( |
std::string const & |
levelPath | ) |
|
Find out if the player has unlocked a level.
- Parameters
-
| levelPath | Path to level xml definition. (Not opened, just used as a key) |
- Returns
- True if the player has unlocked the level, false otherwise.
| bool PlayerProfile::save |
( |
| ) |
const |
Saves the profile to its file.
- Returns
- True if saving was successful.
| void PlayerProfile::unlockLevel |
( |
std::string const & |
levelPath | ) |
|
Unlocks a level for this profile.
- Parameters
-
| levelPath | Path to level xml definition. (Not opened, just used as a key) |
The documentation for this class was generated from the following file: