main class to handle locking/challenges
More...
#include <unlock_manager.hpp>
|
| ~UnlockManager () |
| Saves the challenge status.
|
|
void | addOrFreeChallenge (ChallengeData *c) |
| If a challenge is supported by this binary (i.e.
|
|
void | addListChallenge (ChallengeData *c) |
| Add a challenge to the unlock challenges list.
|
|
void | addChallenge (const std::string &filename) |
| Reads a challenge from the given filename.
|
|
const ChallengeData * | getChallengeData (const std::string &id) |
| Returns the challenge data for a challenge id, or NULL if no such challenge exist.
|
|
bool | isSupportedVersion (const ChallengeData &challenge) |
| Test if the given challenge is supported by this binary.
|
|
void | playLockSound () const |
| Eye- (or rather ear-) candy.
|
|
void | findWhatWasUnlocked (int pointsBefore, int pointsNow, std::vector< std::string > &tracks, std::vector< std::string > &gps, std::vector< std::string > &karts, std::vector< const ChallengeData * > &unlocked) |
| This functions finds what new tracks, GP and karts have been unlocked.
|
|
bool | unlockByPoints (int points, ChallengeStatus *unlock_list) |
| This functions sets as completed the "challenges" requiring a certain number of points, to unlock features.
|
|
bool | unlockSpecial (ChallengeStatus *unlock_list, int max_req_in_lower_diff) |
| This functions sets as completed the "challenges" requiring some special conditions Returns true if the challenge has been completed.
|
|
StoryModeStatus * | createStoryModeStatus (const XMLNode *node=NULL) |
| Creates a game slot.
|
|
|
typedef std::map< std::string, ChallengeData * > | AllChallengesType |
|
|
void | readAllChallengesInDirs (const std::vector< std::string > *all_dirs) |
|
|
SFXBase * | m_locked_sound |
|
AllChallengesType | m_all_challenges |
|
AllChallengesType | m_list_challenges |
|
main class to handle locking/challenges
◆ addChallenge()
void UnlockManager::addChallenge |
( |
const std::string & |
filename | ) |
|
Reads a challenge from the given filename.
The challenge will then either be stored, or (if the challenge version is not supported anymore, freed)
- Parameters
-
filename | Name of the challenge file to read. |
◆ addListChallenge()
Add a challenge to the unlock challenges list.
- Parameters
-
c | The challenge that is either stored or freed. |
◆ addOrFreeChallenge()
If a challenge is supported by this binary (i.e.
has an appropriate challenge version number), add this challenge to the set of all challenges, otherwise free the memory for this challenge.
- Parameters
-
c | The challenge that is either stored or freed. |
◆ createStoryModeStatus()
Creates a game slot.
It initialises the game slot's status with the information in the xml node (if given), basically restoring the saved states for a player.
- Parameters
-
node | The XML game-slots node with all data for a player. |
◆ getChallengeData()
const ChallengeData * UnlockManager::getChallengeData |
( |
const std::string & |
id | ) |
|
Returns the challenge data for a challenge id, or NULL if no such challenge exist.
- Parameters
-
◆ isSupportedVersion()
bool UnlockManager::isSupportedVersion |
( |
const ChallengeData & |
challenge | ) |
|
Test if the given challenge is supported by this binary.
- Parameters
-
challenge | The challenge to test. |
◆ playLockSound()
void UnlockManager::playLockSound |
( |
| ) |
const |
Eye- (or rather ear-) candy.
Play a sound when user tries to access a locked area
◆ unlockByPoints()
bool UnlockManager::unlockByPoints |
( |
int |
points, |
|
|
ChallengeStatus * |
unlock_list |
|
) |
| |
This functions sets as completed the "challenges" requiring a certain number of points, to unlock features.
Returns true if the challenge has been completed
The documentation for this class was generated from the following files: