|
wavelength 1.0.0
|
Settings of the game being set up or played, among them the rule set and the timing the world publishes. More...
#include <gamedb.h>
Public Types | |
| enum | RuleSet { kRuleSetGame = 1 , kRuleSetRemix = 2 , kRuleSetDuel = 3 } |
| Values of mRuleSet, one for each World subclass WorldMgr::Load() can build. More... | |
| enum | Community { kCommunityNone = 0 , kCommunitySolo = 1 , kCommunityLocal = 2 , kCommunityOnline = 3 } |
| Values of mCommunity. More... | |
| enum | SkillLevel { kSkillNovice = 0 , kSkillIntermediate = 1 , kSkillAdvanced = 2 , kSkillInsane = 3 , kSkillAny = 4 } |
| Values of mSkillLevel. More... | |
Public Member Functions | |
| GameDb () | |
| Construct the database with its defaults. | |
| void | Init () |
| Read the "db" section of the configuration. | |
| void | Terminate () |
| Release what Init() created. | |
| void | InitSfx () |
| Build TheFxMidi from the fx_midi_file entry of the "db" section, and start mSfxScheduler at the tempo of that file. | |
| void | TerminateSfx () |
| Stop mSfxScheduler and release TheFxMidi. | |
| void | Poll () |
| Service the database once per frame. | |
| DataArray * | FindSong (const char *pszSong) |
| Find the entry of a song in the "songs" section. | |
| int | GetNumPlayers () const |
| Report the number of players. | |
| void | SetGameParams (const NetGameParams *pParams) |
| Take the settings of an online game the host published. | |
| void | SetRemixBuffer (int nSize) |
| Replace the buffer of the remix data with a new one, billed to RemixBuf. | |
| char * | GetRemixBuffer () |
| Report the buffer of the remix data. | |
| void | SetRemix (const RemixInfo *pInfo) |
| Copy the description of the remix the game plays. | |
| void | SetRemixActive (int nActive) |
| Set the flag that the screens which choose an existing or a tutorial remix set. | |
| int | GetRemixActive () const |
| Report the flag SetRemixActive() set. | |
| void | SetRemixName (const char *pszName) |
| Set mRemixName. | |
| void | GetHostSongs (std::vector< SongEntry > *pSongs, int nSkillLevel, bool bDuelOnly) |
| List the songs of every arena but the tutorial that are available at a skill level, without the songs of type 3 that the first profile has not unlocked. | |
| int | GetNumPads () const |
| Report the number of controllers the players on this console use. | |
| int | IsLocalPlayer (int nPlayer) const |
| Report whether a player plays on this console. | |
| int | GetPlayerSlot (int nPlayer) const |
| Report the slot of a player, which selects the player's sounds and colours. | |
| const char * | GetPlayerName (int nPlayer) const |
| Report the name of a player. | |
| const char * | GetPlayerColor (int nPlayer) const |
| Report the colour symbol of a player's difficulty. | |
| int | GetPlayerNetOrder (int nPlayer) const |
| Report the position of a player in the order of the online session. | |
| int | GetPlayerPad (int nPlayer) const |
| Report the controller of a player. | |
| Campaign * | GetProfile (int nPlayer) |
| Report the profile of a player. | |
| AvatarPartSet * | GetAvatar (int nPlayer) |
| Report the avatar parts of a player, which its profile stores. | |
| int | GetPlayerScore (int nPlayer) const |
| Report the score SetPlayerScore() recorded for a player. | |
| int | GetPlayerRank (int nPlayer) const |
| Report the rank SetPlayerScore() gave a player, 0 for the best score. | |
| InputMap * | GetInputMap (int nPlayer) |
| Report the controller bindings in the profile of a player. | |
| void | SetPlayerScore (int nPlayer, int nScore) |
| Record the score of a player and rank the players by their scores. | |
| const char * | GetDemo () const |
| Report the file of the demo being played. | |
| void | SetWon (bool bWon) |
| Record whether the song was won. | |
| const char * | FindSongGroup () |
| Report the arena whose songs include mSong, the tutorial included. | |
| int | GetSongIndex () |
| Report the index of the arena of the game, from the digit that ends mArena, less one. | |
| GameOptions * | GetOptions () |
| Report the settings of the game options screen. | |
| void | SetOptions (const GameOptions *pOptions) |
| Replace the settings of the game options screen and apply the speaker output mode. | |
| void | SetAvatarCameraParams (float fNear, float fFar) |
| Set the depth range of the camera the avatars share, with Avatar::SetDepthRange(). | |
| void | UnlockAllSongs () |
| Unlock every song. | |
| int | IsWinSequence () const |
| Report whether the campaign win sequence runs. | |
| void | SetWinSequence (bool bWinSequence) |
| Start or end the campaign win sequence. | |
| void | SetPracticeMode (bool bPracticeMode) |
| Set the practice mode. | |
| void | ClearPlayers () |
| Remove every player. | |
| void | AddPlayer (const Campaign *pProfile) |
| Add a player with a copy of a profile. | |
| void | AddPlayer (int bLocal, const Campaign *pProfile, int nSlot, int nNetOrder) |
| Add a player of an online game with a copy of a profile. | |
| void | SetSkillLevel (int nSkillLevel) |
| Set mSkillLevel. | |
| void | SetPowerupLevel (int nPowerupLevel) |
| Set mPowerupLevel. | |
| void | SetTutorial (int nTutorial) |
| Set whether the tutorial is played. | |
| void | SetSong (const char *pszSong) |
| Set mSong. | |
| void | SetLoadRemix (bool bLoadRemix) |
| Set mLoadRemix. | |
| void | SetRuleSet (int nRuleSet) |
| Set mRuleSet. | |
| void | SetCommunity (int nCommunity) |
| Set mCommunity. | |
| void | SetMaxPlayers (int nMaxPlayers) |
| Set mMaxPlayers. | |
| void | SetDemo (const char *pszDemo) |
| Choose the demo to play, or none. | |
| void | SetEnergized (float fEnergized) |
| Record the fraction of the possible capture bars a solo song captured. | |
| void | SetFullMixBars (int nBars) |
| Record the bars a solo song played with every track captured. | |
| void | SetBestStreak (int nStreak) |
| Record the longest streak of a solo song. | |
| void | SetProgress (float fProgress) |
| Record the fraction of the song played. | |
| float | GetEnergized () const |
| Report the value of SetEnergized(). | |
| int | GetFullMixBars () const |
| Report the value of SetFullMixBars(). | |
| int | GetBestStreak () const |
| Report the value of SetBestStreak(). | |
| float | GetProgress () const |
| Report the value of SetProgress(). | |
| void | SetArena (const char *pszArena) |
| Set the arena of the game. | |
| RemixInfo * | GetRemixInfo () |
| Report the description of the remix being played. | |
| void | SetRemixReadOnly (int nReadOnly) |
| Set mRemixReadOnly. | |
| int | GetNetRemixEnded () const |
| Report whether the remix of an online game has ended. | |
| void | SetNetRemixEnded (int nEnded) |
| Record whether the remix of an online game has ended. | |
| const char * | GetDifficultyName () const |
| Report the localised name of the difficulty of the game. | |
| const char * | GetDifficultyName (int nSkillLevel, int nRuleSet) const |
| Report the localised name of a difficulty. | |
| const char * | GetModeName () const |
| Report the localised name of the mode of the game, from mRuleSet. | |
| const char * | GetModeName (int nRuleSet) const |
| Report the localised name of a mode. | |
| const char * | GetPowerupName (int nPowerupLevel) const |
| Report the localised name of a power-up level. | |
| void | GetArenaNames (std::vector< const char * > *pArenas, bool bIncludeTutorial) |
| Append the names of the arenas of the "arenas" section, in their order there. | |
| void | GetUnlockedArenas (std::vector< const char * > *pArenas, int nSkillLevel, bool bFirstPlayerOnly, bool bIncludeTutorial) |
| List the arenas the players have unlocked at a skill level. | |
| void | GetArenaSongs (std::vector< SongEntry > *pSongs, const char *pszArena, int nSkillLevel, int nFilter) |
| Append the songs of an arena that are available at a skill level. | |
| void | GetUnlockedSongs (std::vector< SongEntry > *pSongs, const char *pszArena, int nSkillLevel, bool bFirstPlayerOnly) |
| List the songs the players have unlocked in an arena, or in every unlocked arena. | |
| void | GetAllSongs (std::vector< SongEntry > *pSongs, bool bDuelOnly, int nSkillLevel) |
| List the songs of every arena but the tutorial that are available at a skill level. | |
| bool | HasSong (const char *pszSong) |
| Report whether an arena lists a song. | |
| bool | FindSongById (DataArray **ppSong, int nId) |
| Find the song whose id matches. | |
| const std::vector< std::unique_ptr< PlayerInfo > > & | GetPlayers () const |
| const String & | GetSong () const |
| int | GetLoadRemix () const |
| int | GetRemixReadOnly () const |
| const String & | GetRemixName () const |
| void | SetRemixName (const String &name) |
| Set the name of the saved remix played. | |
| int | GetPracticeMode () const |
| int | GetTutorial () const |
| int | GetSkillLevel () const |
| int | GetPowerupLevel () const |
| int | GetRuleSet () const |
| int | GetCommunity () const |
| int | GetMaxPlayers () const |
| const String & | GetArena () const |
| void | SetArena (const String &arena) |
| Set the arena of the game from a string. | |
| int | GetUnlockAll () const |
| int | GetWon () const |
| int | GetReservedA4 () const |
| void | SetReservedA4 (int nValue) |
| Set the value at +0xa4, not yet identified. | |
| DataArray * | GetSongs () const |
| void | SetSongs (DataArray *pSongs) |
| Set the songs array of the "db" section. | |
| float | GetSongTick () const |
| void | SetSongTick (float fTick) |
| Set the running world's position in ticks. | |
| float | GetSongTime () const |
| void | SetSongTime (float fTime) |
| Set the running world's position on its song clock. | |
| Scheduler & | GetSfxScheduler () |
| const Scheduler & | GetSfxScheduler () const |
Static Public Member Functions | |
| static GameDb * | shared () |
| Report the single instance, constructing it on first use. | |
Static Public Attributes | |
| static constexpr int | kPowerupLevelNone = 2 |
| The value of mPowerupLevel that places no power-up. | |
Settings of the game being set up or played, among them the rule set and the timing the world publishes.
The class is not polymorphic and has no RTTI. The name is inferred from the "db" section of the configuration Init() reads. The one instance is the function-local static of shared(), and TheGameDb addresses it. WorldMgr::Load() reads the rule set from +0x50, and WorldMgr::UpdateTime() writes the two timing floats at +0x158 and +0x15c.
| enum GameDb::RuleSet |
Values of mRuleSet, one for each World subclass WorldMgr::Load() can build.
| Enumerator | |
|---|---|
| kRuleSetGame | WorldMgr::Load() builds a Game. |
| kRuleSetRemix | WorldMgr::Load() builds a Remix. |
| kRuleSetDuel | WorldMgr::Load() builds a Duel. |
| enum GameDb::Community |
| enum GameDb::SkillLevel |
| GameDb::GameDb | ( | ) |
Construct the database with its defaults.
|
static |
Report the single instance, constructing it on first use.
| void GameDb::Init | ( | ) |
Read the "db" section of the configuration.
| void GameDb::Terminate | ( | ) |
| void GameDb::InitSfx | ( | ) |
Build TheFxMidi from the fx_midi_file entry of the "db" section, and start mSfxScheduler at the tempo of that file.
Init() calls it. The PAL build reads the <language>_fx_midi_file entry of the console's language instead.
| void GameDb::TerminateSfx | ( | ) |
Stop mSfxScheduler and release TheFxMidi.
Terminate() calls it.
| void GameDb::Poll | ( | ) |
Service the database once per frame.
| DataArray * GameDb::FindSong | ( | const char * | pszSong | ) |
Find the entry of a song in the "songs" section.
| pszSong | The song. |
| int GameDb::GetNumPlayers | ( | ) | const |
Report the number of players.
| void GameDb::SetGameParams | ( | const NetGameParams * | pParams | ) |
Take the settings of an online game the host published.
| pParams | The settings. |
| void GameDb::SetRemixBuffer | ( | int | nSize | ) |
Replace the buffer of the remix data with a new one, billed to RemixBuf.
| nSize | The size of the new buffer, or 0 for none. |
|
inline |
Report the buffer of the remix data.
| void GameDb::SetRemix | ( | const RemixInfo * | pInfo | ) |
Copy the description of the remix the game plays.
| pInfo | The description. |
| void GameDb::SetRemixActive | ( | int | nActive | ) |
Set the flag that the screens which choose an existing or a tutorial remix set.
The name is inferred.
| nActive | The flag. |
| int GameDb::GetRemixActive | ( | ) | const |
Report the flag SetRemixActive() set.
The name is inferred.
| void GameDb::SetRemixName | ( | const char * | pszName | ) |
Set mRemixName.
| pszName | The name of the saved remix played. |
| void GameDb::GetHostSongs | ( | std::vector< SongEntry > * | pSongs, |
| int | nSkillLevel, | ||
| bool | bDuelOnly ) |
List the songs of every arena but the tutorial that are available at a skill level, without the songs of type 3 that the first profile has not unlocked.
The name is inferred.
| pSongs | The list to fill. |
| nSkillLevel | The skill level, or 4 for any. |
| bDuelOnly | Whether only the songs a duel can play are listed. |
| int GameDb::GetNumPads | ( | ) | const |
Report the number of controllers the players on this console use.
| int GameDb::IsLocalPlayer | ( | int | nPlayer | ) | const |
Report whether a player plays on this console.
| nPlayer | The player. |
| int GameDb::GetPlayerSlot | ( | int | nPlayer | ) | const |
Report the slot of a player, which selects the player's sounds and colours.
| nPlayer | The player. |
| const char * GameDb::GetPlayerName | ( | int | nPlayer | ) | const |
Report the name of a player.
| nPlayer | The player. |
| const char * GameDb::GetPlayerColor | ( | int | nPlayer | ) | const |
Report the colour symbol of a player's difficulty.
The name is inferred.
| nPlayer | The player. |
| int GameDb::GetPlayerNetOrder | ( | int | nPlayer | ) | const |
Report the position of a player in the order of the online session.
| nPlayer | The player. |
| int GameDb::GetPlayerPad | ( | int | nPlayer | ) | const |
Report the controller of a player.
An online session gives every local player controller 0 and every other player none.
| nPlayer | The player. |
| Campaign * GameDb::GetProfile | ( | int | nPlayer | ) |
Report the profile of a player.
| nPlayer | The player. |
| AvatarPartSet * GameDb::GetAvatar | ( | int | nPlayer | ) |
Report the avatar parts of a player, which its profile stores.
| nPlayer | The player. |
| int GameDb::GetPlayerScore | ( | int | nPlayer | ) | const |
Report the score SetPlayerScore() recorded for a player.
| nPlayer | The player. |
| int GameDb::GetPlayerRank | ( | int | nPlayer | ) | const |
Report the rank SetPlayerScore() gave a player, 0 for the best score.
| nPlayer | The player. |
| InputMap * GameDb::GetInputMap | ( | int | nPlayer | ) |
Report the controller bindings in the profile of a player.
| nPlayer | The player. |
| void GameDb::SetPlayerScore | ( | int | nPlayer, |
| int | nScore ) |
Record the score of a player and rank the players by their scores.
| nPlayer | The player. |
| nScore | The score. |
| const char * GameDb::GetDemo | ( | ) | const |
Report the file of the demo being played.
| void GameDb::SetWon | ( | bool | bWon | ) |
Record whether the song was won.
| bWon | Whether the song was won. |
| const char * GameDb::FindSongGroup | ( | ) |
Report the arena whose songs include mSong, the tutorial included.
| int GameDb::GetSongIndex | ( | ) |
Report the index of the arena of the game, from the digit that ends mArena, less one.
| GameOptions * GameDb::GetOptions | ( | ) |
Report the settings of the game options screen.
| void GameDb::SetOptions | ( | const GameOptions * | pOptions | ) |
Replace the settings of the game options screen and apply the speaker output mode.
| pOptions | The settings. |
| void GameDb::SetAvatarCameraParams | ( | float | fNear, |
| float | fFar ) |
Set the depth range of the camera the avatars share, with Avatar::SetDepthRange().
The metagame passes 0.05 and 1 as the front end starts. The name is inferred.
| fNear | The near end of the range. |
| fFar | The far end of the range. |
| void GameDb::UnlockAllSongs | ( | ) |
Unlock every song.
The unlock_all songs cheat calls it. The name is inferred.
| int GameDb::IsWinSequence | ( | ) | const |
Report whether the campaign win sequence runs.
| void GameDb::SetWinSequence | ( | bool | bWinSequence | ) |
Start or end the campaign win sequence.
| bWinSequence | Start the sequence. |
| void GameDb::SetPracticeMode | ( | bool | bPracticeMode | ) |
Set the practice mode.
| bPracticeMode | Play in practice mode. |
| void GameDb::ClearPlayers | ( | ) |
Remove every player.
| void GameDb::AddPlayer | ( | const Campaign * | pProfile | ) |
Add a player with a copy of a profile.
| pProfile | The profile to copy. |
| void GameDb::AddPlayer | ( | int | bLocal, |
| const Campaign * | pProfile, | ||
| int | nSlot, | ||
| int | nNetOrder ) |
Add a player of an online game with a copy of a profile.
| bLocal | Non-zero for the player of this console, which also counts it as local. |
| pProfile | The profile to copy. |
| nSlot | The value GetPlayerSlot() reports for the player. |
| nNetOrder | The value GetPlayerNetOrder() reports for the player. |
| void GameDb::SetSkillLevel | ( | int | nSkillLevel | ) |
Set mSkillLevel.
| nSkillLevel | The skill level. |
| void GameDb::SetPowerupLevel | ( | int | nPowerupLevel | ) |
Set mPowerupLevel.
| nPowerupLevel | The power-up level. |
| void GameDb::SetTutorial | ( | int | nTutorial | ) |
Set whether the tutorial is played.
The solo arena screen sets it when the player confirms the "Tutorial" arena, and the song screen sets it for a song whose type is 4. Every other way into a song clears it.
| nTutorial | Non-zero to play the tutorial. |
| void GameDb::SetSong | ( | const char * | pszSong | ) |
Set mSong.
| pszSong | The song. |
| void GameDb::SetLoadRemix | ( | bool | bLoadRemix | ) |
Set mLoadRemix.
| bLoadRemix | Whether a saved remix is played. |
| void GameDb::SetRuleSet | ( | int | nRuleSet | ) |
Set mRuleSet.
| nRuleSet | One of RuleSet. |
| void GameDb::SetCommunity | ( | int | nCommunity | ) |
Set mCommunity.
| nCommunity | One of Community. |
| void GameDb::SetMaxPlayers | ( | int | nMaxPlayers | ) |
Set mMaxPlayers.
| nMaxPlayers | The number of players the session takes. |
| void GameDb::SetDemo | ( | const char * | pszDemo | ) |
Choose the demo to play, or none.
| pszDemo | The demo recording, or null for none. |
| void GameDb::SetEnergized | ( | float | fEnergized | ) |
Record the fraction of the possible capture bars a solo song captured.
| fEnergized | The fraction. |
| void GameDb::SetFullMixBars | ( | int | nBars | ) |
Record the bars a solo song played with every track captured.
| nBars | The bars. |
| void GameDb::SetBestStreak | ( | int | nStreak | ) |
Record the longest streak of a solo song.
| nStreak | The streak. |
| void GameDb::SetProgress | ( | float | fProgress | ) |
Record the fraction of the song played.
| fProgress | The fraction. |
| float GameDb::GetEnergized | ( | ) | const |
Report the value of SetEnergized().
| int GameDb::GetFullMixBars | ( | ) | const |
Report the value of SetFullMixBars().
| int GameDb::GetBestStreak | ( | ) | const |
Report the value of SetBestStreak().
| float GameDb::GetProgress | ( | ) | const |
Report the value of SetProgress().
| void GameDb::SetArena | ( | const char * | pszArena | ) |
Set the arena of the game.
| pszArena | The arena. |
| RemixInfo * GameDb::GetRemixInfo | ( | ) |
Report the description of the remix being played.
| void GameDb::SetRemixReadOnly | ( | int | nReadOnly | ) |
Set mRemixReadOnly.
| nReadOnly | Non-zero when the remix may not be saved over. |
| int GameDb::GetNetRemixEnded | ( | ) | const |
Report whether the remix of an online game has ended.
| void GameDb::SetNetRemixEnded | ( | int | nEnded | ) |
Record whether the remix of an online game has ended.
| nEnded | Non-zero once the remix has ended. |
| const char * GameDb::GetDifficultyName | ( | ) | const |
Report the localised name of the difficulty of the game.
| const char * GameDb::GetDifficultyName | ( | int | nSkillLevel, |
| int | nRuleSet ) const |
Report the localised name of a difficulty.
| nSkillLevel | The skill level. |
| nRuleSet | The rule set, one of RuleSet. |
| const char * GameDb::GetModeName | ( | ) | const |
Report the localised name of the mode of the game, from mRuleSet.
| const char * GameDb::GetModeName | ( | int | nRuleSet | ) | const |
Report the localised name of a mode.
| nRuleSet | The rule set, one of RuleSet. |
| const char * GameDb::GetPowerupName | ( | int | nPowerupLevel | ) | const |
Report the localised name of a power-up level.
The name is inferred.
| nPowerupLevel | The level, 0 to 2. |
| void GameDb::GetArenaNames | ( | std::vector< const char * > * | pArenas, |
| bool | bIncludeTutorial ) |
Append the names of the arenas of the "arenas" section, in their order there.
| pArenas | The list to append to. |
| bIncludeTutorial | Whether the Tutorial arena is listed. |
| void GameDb::GetUnlockedArenas | ( | std::vector< const char * > * | pArenas, |
| int | nSkillLevel, | ||
| bool | bFirstPlayerOnly, | ||
| bool | bIncludeTutorial ) |
List the arenas the players have unlocked at a skill level.
| pArenas | The list to fill. |
| nSkillLevel | The skill level, or 4 for any. |
| bFirstPlayerOnly | Whether only the first player's unlocks count. |
| bIncludeTutorial | Whether the Tutorial arena is considered. |
| void GameDb::GetArenaSongs | ( | std::vector< SongEntry > * | pSongs, |
| const char * | pszArena, | ||
| int | nSkillLevel, | ||
| int | nFilter ) |
Append the songs of an arena that are available at a skill level.
| pSongs | The list to append to. |
| pszArena | The arena. |
| nSkillLevel | The skill level, or 4 for any. |
| nFilter | Which songs are listed. The callers pass 0 and 1. |
| void GameDb::GetUnlockedSongs | ( | std::vector< SongEntry > * | pSongs, |
| const char * | pszArena, | ||
| int | nSkillLevel, | ||
| bool | bFirstPlayerOnly ) |
List the songs the players have unlocked in an arena, or in every unlocked arena.
| pSongs | The list to fill. |
| pszArena | The arena, or an empty string for every unlocked arena. |
| nSkillLevel | The skill level, or 4 for any. |
| bFirstPlayerOnly | Whether only the first player's unlocks count. |
| void GameDb::GetAllSongs | ( | std::vector< SongEntry > * | pSongs, |
| bool | bDuelOnly, | ||
| int | nSkillLevel ) |
List the songs of every arena but the tutorial that are available at a skill level.
| pSongs | The list to fill. |
| bDuelOnly | Whether only the songs a duel can play are listed. |
| nSkillLevel | The skill level, or kSkillAny. |
| bool GameDb::HasSong | ( | const char * | pszSong | ) |
Report whether an arena lists a song.
| pszSong | The song. |
| bool GameDb::FindSongById | ( | DataArray ** | ppSong, |
| int | nId ) |
Find the song whose id matches.
| ppSong | Receives the entry of the song found in the last arena that lists one. |
| nId | The identifier. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the name of the saved remix played.
| name | The name. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the arena of the game from a string.
| arena | The arena. |
|
inline |
|
inline |
|
inline |
|
inline |
Set the value at +0xa4, not yet identified.
| nValue | The value. |
|
inline |
|
inline |
Set the songs array of the "db" section.
Borrowed.
| pSongs | The array. The caller retains ownership. |
|
inline |
|
inline |
Set the running world's position in ticks.
| fTick | The position in ticks. |
|
inline |
|
inline |
Set the running world's position on its song clock.
| fTime | The position on the song clock. |
|
inline |
|
inline |
|
staticconstexpr |
The value of mPowerupLevel that places no power-up.