|
wavelength 1.0.0
|
Saved settings and progress of one player, among them the controller bindings. More...
#include <campaign.h>
Public Types | |
| enum | Flag { kFlagAutocatcher = 0 , kFlagMultiplier = 1 , kFlagSlowdown = 2 , kFlagFreestyle = 3 , kFlagFreestyleTip = 4 , kFlagNone = 5 } |
| Bits of mFlags. More... | |
| enum | Medal { kMedalNone = 0 , kMedalFinished = 1 , kMedalFirst = 2 , kMedalSecond = 3 , kMedalThird = 4 } |
| Values of GetMedal() and GetMedalForScore(), one more than the goals of the score_goal of the song a score passes. More... | |
Public Member Functions | |
| bool | CompletesTier (const char *pszSong, int nSkillLevel) |
| Report whether a song is the one song of its campaign tier the player has not yet won. | |
| InputMap * | GetInputMap () |
| Report the controller bindings. | |
| void | SetInputMap (const InputMap *pMap) |
| Replace the controller bindings and mark the profile modified. | |
| int | HasSeenFreestyleTip () |
| Report whether the tip about the freestyle lap has shown. | |
| void | SetSeenFreestyleTip () |
| Record that the tip about the freestyle lap has shown. | |
| const char * | FindFirstUnfinishedSong (int nSkillLevel) |
| Report the first song of the unlocked arenas the player has not finished at a skill level. | |
| void | GetClearedSongs (int nSkillLevel, const char *pszGroup, std::vector< bool > *pCleared) |
| Report which songs of a group the player has cleared at a skill level. | |
| bool | IsUnlocked (const char *pszItem, int nSkillLevel) |
| Report whether the player has unlocked an item at a skill level. | |
| void | GetUnlockedParts (int nPart, std::vector< const char * > *pTypes) |
| List the choices of an avatar part the player may use. | |
| void | GetUnlockedEmblems (std::vector< const char * > *pTypes) |
| List the emblems the player may use. | |
| void | RemoveLockedItems (std::vector< const char * > *pItems) |
| Remove the items the player has not unlocked at any skill level from a list. | |
| int | GetSoloOption () const |
| Report the display option the player chose for the solo game. | |
| int | GetOnlineOption () const |
| Report the display option the player chose for the online game. | |
| void | SetSoloOption (int nOption) |
| Record the display option for the solo game and mark the profile changed. | |
| void | SetOnlineOption (int nOption) |
| Record the display option for the online game. | |
| Campaign () | |
| Construct a profile with the default settings and the unlocks of the always entries. | |
| Campaign (const Campaign &other) | |
| Copy a profile. | |
| ~Campaign () | |
| Destroy the profile. | |
| Campaign & | operator= (const Campaign &other) |
| Copy another profile into this one. | |
| bool | IsSongFinished (const char *pszSong, int nSkillLevel) |
| Report whether a song was finished at a skill level. | |
| bool | HasBeatenGame (int nSkillLevel) |
| Report whether the player has beaten the game at a skill level, the symbol beat_game among the unlocks of that level. | |
| int | GetHighestBeatenSkillLevel () |
| Report the highest skill level at which the player has beaten the game. | |
| void | GetSongStats (const char *pszSong, int nSkillLevel, SongStats *pRecord) |
| Copy the record of a song at a skill level. | |
| void | RecordResult (const SongStats *pRecord, std::vector< UnlockableItem > *pUnlocks) |
| Record the result of a song and collect the items it unlocks. | |
| int | GetArenaScore (const char *pszArena, int nSkillLevel) |
| Report the sum of the best scores of the songs of an arena. | |
| int | GetArenaScoreToBeat (const char *pszArena, int nSkillLevel) |
| Report the arena score to beat, from the arena_scores of the "db" section. | |
| int | GetMedal (const char *pszSong, int nSkillLevel) |
| Report the medal of a song at a skill level. | |
| int | GetMedalForScore (const char *pszSong, int nSkillLevel, int nScore, int nPercent) |
| Report the medal a score earns on a song at a skill level. | |
| const char * | TakePendingPowerup (int nSkillLevel) |
| Grant the power-up of mPendingPowerup once it is unlocked at a skill level, and clear it. | |
| int | IsModified () const |
| Report mModified. | |
| void | SetModified (int nModified) |
| Set mModified. | |
| void | Save (BinStream &stream) const |
| Write the profile, at version 6. | |
| void | Load (BinStream &stream) |
| Read a profile Save() wrote, and rebuild the unlocks from the records. | |
| const String & | GetPassword () const |
| void | SetPassword (const char *pszPassword) |
| int | GetNameLocked () const |
| void | SetNameLocked (int nNameLocked) |
| const String & | GetName () const |
| void | SetName (const char *pszName) |
| int | GetCustom () const |
| void | SetCustom (int nCustom) |
| const DateTime & | GetBorn () const |
| DateTime & | GetBorn () |
| const AvatarPartSet & | GetAvatar () const |
| AvatarPartSet & | GetAvatar () |
| void | SetAvatar (const AvatarPartSet &avatar) |
Static Public Member Functions | |
| static void | UnlockAllParts () |
| Count every avatar part and emblem as unlocked for every profile. | |
| static void | UnlockAllSongs () |
| Count every song as unlocked for every profile, by setting g_dwUnlockAllSongs. | |
Saved settings and progress of one player, among them the controller bindings.
The class is not polymorphic. The name comes from the RTTI of the vectors that store it. Each player entry of GameDb stores one at +0x10. The object is 0xf8 bytes.
| enum Campaign::Flag |
Bits of mFlags.
The names are inferred.
| enum Campaign::Medal |
Values of GetMedal() and GetMedalForScore(), one more than the goals of the score_goal of the song a score passes.
The names are inferred.
| Campaign::Campaign | ( | ) |
Construct a profile with the default settings and the unlocks of the always entries.
| Campaign::Campaign | ( | const Campaign & | other | ) |
Copy a profile.
| other | The profile to copy. |
| Campaign::~Campaign | ( | ) |
Destroy the profile.
| bool Campaign::CompletesTier | ( | const char * | pszSong, |
| int | nSkillLevel ) |
Report whether a song is the one song of its campaign tier the player has not yet won.
Bonus songs and secret songs do not count. The name is inferred.
| pszSong | The song. |
| nSkillLevel | The skill level. |
| InputMap * Campaign::GetInputMap | ( | ) |
Report the controller bindings.
| void Campaign::SetInputMap | ( | const InputMap * | pMap | ) |
Replace the controller bindings and mark the profile modified.
| pMap | The bindings to copy. |
| int Campaign::HasSeenFreestyleTip | ( | ) |
Report whether the tip about the freestyle lap has shown.
The name is inferred.
| void Campaign::SetSeenFreestyleTip | ( | ) |
Record that the tip about the freestyle lap has shown.
The name is inferred.
| const char * Campaign::FindFirstUnfinishedSong | ( | int | nSkillLevel | ) |
Report the first song of the unlocked arenas the player has not finished at a skill level.
Bonus songs and secret songs do not count.
| nSkillLevel | The skill level. |
| void Campaign::GetClearedSongs | ( | int | nSkillLevel, |
| const char * | pszGroup, | ||
| std::vector< bool > * | pCleared ) |
Report which songs of a group the player has cleared at a skill level.
Only the songs of type SongEntry::kTypeNormal available at the skill level count.
| nSkillLevel | The skill level. |
| pszGroup | The group, the name of an arena. |
| pCleared | Receives one flag for each song of the group. |
| bool Campaign::IsUnlocked | ( | const char * | pszItem, |
| int | nSkillLevel ) |
Report whether the player has unlocked an item at a skill level.
An item unlocked for every skill level counts at each.
| pszItem | The item. |
| nSkillLevel | The skill level, or GameDb::kSkillAny for any. |
| void Campaign::GetUnlockedParts | ( | int | nPart, |
| std::vector< const char * > * | pTypes ) |
List the choices of an avatar part the player may use.
Every choice qualifies while g_dwUnlockAllParts is set. The name is inferred.
| nPart | One of AvatarPartSet::Part. |
| pTypes | Receives the symbols of the choices. |
| void Campaign::GetUnlockedEmblems | ( | std::vector< const char * > * | pTypes | ) |
List the emblems the player may use.
Every emblem qualifies while g_dwUnlockAllParts is set. The name is inferred.
| pTypes | Receives the symbols of the emblems. |
| void Campaign::RemoveLockedItems | ( | std::vector< const char * > * | pItems | ) |
Remove the items the player has not unlocked at any skill level from a list.
The name is inferred.
| pItems | The symbols of the items. |
| int Campaign::GetSoloOption | ( | ) | const |
Report the display option the player chose for the solo game.
| int Campaign::GetOnlineOption | ( | ) | const |
Report the display option the player chose for the online game.
| void Campaign::SetSoloOption | ( | int | nOption | ) |
Record the display option for the solo game and mark the profile changed.
| nOption | The option. |
| void Campaign::SetOnlineOption | ( | int | nOption | ) |
Record the display option for the online game.
| nOption | The option. |
|
static |
Count every avatar part and emblem as unlocked for every profile.
|
static |
Count every song as unlocked for every profile, by setting g_dwUnlockAllSongs.
The name is inferred.
Copy another profile into this one.
| other | The profile to copy. |
| bool Campaign::IsSongFinished | ( | const char * | pszSong, |
| int | nSkillLevel ) |
Report whether a song was finished at a skill level.
A song counts when its record shows the whole song played. Skill level 4 accepts a finished record at any skill level. Every song counts while the unlock-all setting is on. The name is inferred.
| pszSong | The song. |
| nSkillLevel | The skill level, or 4 for any. |
| bool Campaign::HasBeatenGame | ( | int | nSkillLevel | ) |
Report whether the player has beaten the game at a skill level, the symbol beat_game among the unlocks of that level.
Every level counts while the unlock-all setting is on. The name is inferred.
| nSkillLevel | The skill level. |
| int Campaign::GetHighestBeatenSkillLevel | ( | ) |
Report the highest skill level at which the player has beaten the game.
The name is inferred.
| void Campaign::GetSongStats | ( | const char * | pszSong, |
| int | nSkillLevel, | ||
| SongStats * | pRecord ) |
Copy the record of a song at a skill level.
Without a record, the copy is a cleared record of the song and the skill level.
| pszSong | The song. |
| nSkillLevel | The skill level. |
| pRecord | The record to fill. |
| void Campaign::RecordResult | ( | const SongStats * | pRecord, |
| std::vector< UnlockableItem > * | pUnlocks ) |
Record the result of a song and collect the items it unlocks.
While the unlock-all-songs cheat is on, the result is not recorded and the list is emptied.
| pRecord | The result. |
| pUnlocks | Receives the items the result unlocks. |
| int Campaign::GetArenaScore | ( | const char * | pszArena, |
| int | nSkillLevel ) |
Report the sum of the best scores of the songs of an arena.
The name is inferred.
| pszArena | The arena. |
| nSkillLevel | The skill level. |
| int Campaign::GetArenaScoreToBeat | ( | const char * | pszArena, |
| int | nSkillLevel ) |
Report the arena score to beat, from the arena_scores of the "db" section.
The profile itself is not read. The name is inferred.
| pszArena | The arena. |
| nSkillLevel | The skill level. |
| int Campaign::GetMedal | ( | const char * | pszSong, |
| int | nSkillLevel ) |
Report the medal of a song at a skill level.
The name is inferred.
| pszSong | The song. |
| nSkillLevel | The skill level. |
| int Campaign::GetMedalForScore | ( | const char * | pszSong, |
| int | nSkillLevel, | ||
| int | nScore, | ||
| int | nPercent ) |
Report the medal a score earns on a song at a skill level.
The name is inferred.
| pszSong | The song. |
| nSkillLevel | The skill level. |
| nScore | The score. |
| nPercent | The share of the song played, in percent. Only 100 earns a medal. |
| const char * Campaign::TakePendingPowerup | ( | int | nSkillLevel | ) |
Grant the power-up of mPendingPowerup once it is unlocked at a skill level, and clear it.
The name is inferred.
| nSkillLevel | The skill level. |
| int Campaign::IsModified | ( | ) | const |
Report mModified.
| void Campaign::SetModified | ( | int | nModified | ) |
Set mModified.
| nModified | Non-zero when the profile changed since it was saved. |
| void Campaign::Save | ( | BinStream & | stream | ) | const |
Write the profile, at version 6.
| stream | The stream. |
| void Campaign::Load | ( | BinStream & | stream | ) |
Read a profile Save() wrote, and rebuild the unlocks from the records.
Versions before 4 take the bindings of the input_map of the "db" section, versions before 5 clear mFlags, and versions before 6 reset the last unlock of each kind.
| stream | The stream. |
|
inline |
|
inline |
| pszPassword | The online password, or empty when it is not saved. |
|
inline |
|
inline |
| nNameLocked | Non-zero when the player may not rename the Freq. |
|
inline |
|
inline |
| pszName | The player's name. |
|
inline |
|
inline |
| nCustom | Non-zero for a player's own profile, not a default one. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| avatar | The Freq's parts and colours. |