const
This commit is contained in:
@@ -72,20 +72,22 @@ ProfileManager::~ProfileManager()
|
||||
SaveMachineProfile();
|
||||
}
|
||||
|
||||
void ProfileManager::GetLocalProfileIDs( vector<CString> &asProfileIDsOut )
|
||||
void ProfileManager::GetLocalProfileIDs( vector<CString> &asProfileIDsOut ) const
|
||||
{
|
||||
GetDirListing( USER_PROFILES_DIR "*", asProfileIDsOut, true, false );
|
||||
}
|
||||
|
||||
void ProfileManager::GetLocalProfileNames( vector<CString> &asNamesOut )
|
||||
void ProfileManager::GetLocalProfileNames( vector<CString> &asNamesOut ) const
|
||||
{
|
||||
CStringArray vsProfileIDs;
|
||||
GetLocalProfileIDs( vsProfileIDs );
|
||||
LOG->Trace("GetLocalProfileNames: %i", vsProfileIDs.size());
|
||||
for( unsigned i=0; i<vsProfileIDs.size(); i++ )
|
||||
{
|
||||
CString sProfileID = vsProfileIDs[i];
|
||||
CString sProfileDir = USER_PROFILES_DIR + sProfileID + "/";
|
||||
CString sDisplayName = Profile::GetProfileDisplayNameFromDir( sProfileDir );
|
||||
LOG->Trace(" '%s'", sDisplayName.c_str());
|
||||
asNamesOut.push_back( sDisplayName );
|
||||
}
|
||||
}
|
||||
@@ -200,7 +202,7 @@ bool ProfileManager::CreateMemoryCardProfile( PlayerNumber pn )
|
||||
// return false;
|
||||
//}
|
||||
|
||||
bool ProfileManager::SaveProfile( PlayerNumber pn )
|
||||
bool ProfileManager::SaveProfile( PlayerNumber pn ) const
|
||||
{
|
||||
if( m_sProfileDir[pn].empty() )
|
||||
return false;
|
||||
@@ -223,9 +225,9 @@ const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const
|
||||
return &m_Profile[pn];
|
||||
}
|
||||
|
||||
CString ProfileManager::GetPlayerName( PlayerNumber pn )
|
||||
CString ProfileManager::GetPlayerName( PlayerNumber pn ) const
|
||||
{
|
||||
Profile *prof = GetProfile( pn );
|
||||
const Profile *prof = GetProfile( pn );
|
||||
if( prof )
|
||||
return prof->m_sLastUsedHighScoreName;
|
||||
|
||||
@@ -388,12 +390,12 @@ void ProfileManager::ReadSM300NoteScores()
|
||||
}
|
||||
*/
|
||||
|
||||
bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn )
|
||||
bool ProfileManager::ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const
|
||||
{
|
||||
return GetProfile(pn) && m_bWasLoadedFromMemoryCard[pn];
|
||||
}
|
||||
|
||||
CString ProfileManager::GetProfileDir( ProfileSlot slot )
|
||||
CString ProfileManager::GetProfileDir( ProfileSlot slot ) const
|
||||
{
|
||||
switch( slot )
|
||||
{
|
||||
@@ -450,14 +452,14 @@ void ProfileManager::IncrementStepsPlayCount( const Steps* pSteps, PlayerNumber
|
||||
PROFILEMAN->GetMachineProfile()->IncrementStepsPlayCount( pSteps );
|
||||
}
|
||||
|
||||
HighScore ProfileManager::GetHighScoreForDifficulty( const Song *s, const StyleDef *st, ProfileSlot slot, Difficulty dc )
|
||||
HighScore ProfileManager::GetHighScoreForDifficulty( const Song *s, const StyleDef *st, ProfileSlot slot, Difficulty dc ) const
|
||||
{
|
||||
// return max grade of notes in difficulty class
|
||||
vector<Steps*> aNotes;
|
||||
s->GetSteps( aNotes, st->m_StepsType );
|
||||
SortNotesArrayByDifficulty( aNotes );
|
||||
|
||||
Steps* pSteps = s->GetStepsByDifficulty( st->m_StepsType, dc );
|
||||
const Steps* pSteps = s->GetStepsByDifficulty( st->m_StepsType, dc );
|
||||
|
||||
if( PROFILEMAN->IsUsingProfile(slot) )
|
||||
return PROFILEMAN->GetProfile(slot)->GetStepsHighScoreList(pSteps).GetTopScore();
|
||||
|
||||
@@ -30,12 +30,12 @@ public:
|
||||
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
||||
bool DeleteLocalProfile( CString sProfileID );
|
||||
|
||||
void GetLocalProfileIDs( vector<CString> &asProfileIDsOut );
|
||||
void GetLocalProfileNames( vector<CString> &asNamesOut );
|
||||
void GetLocalProfileIDs( vector<CString> &asProfileIDsOut ) const;
|
||||
void GetLocalProfileNames( vector<CString> &asNamesOut ) const;
|
||||
|
||||
bool LoadProfileFromMemoryCard( PlayerNumber pn );
|
||||
// bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile
|
||||
bool SaveProfile( PlayerNumber pn );
|
||||
bool SaveProfile( PlayerNumber pn ) const;
|
||||
void UnloadProfile( PlayerNumber pn );
|
||||
|
||||
//
|
||||
@@ -44,8 +44,8 @@ public:
|
||||
void LoadMachineProfile();
|
||||
void SaveMachineProfile();
|
||||
|
||||
bool IsUsingProfile( PlayerNumber pn ) { return !m_sProfileDir[pn].empty(); }
|
||||
bool IsUsingProfile( ProfileSlot slot )
|
||||
bool IsUsingProfile( PlayerNumber pn ) const { return !m_sProfileDir[pn].empty(); }
|
||||
bool IsUsingProfile( ProfileSlot slot ) const
|
||||
{
|
||||
switch( slot )
|
||||
{
|
||||
@@ -63,12 +63,12 @@ public:
|
||||
Profile* GetProfile( PlayerNumber pn ) { return (Profile*) ((const ProfileManager *) this)->GetProfile(pn); }
|
||||
const Profile* GetProfile( ProfileSlot slot ) const;
|
||||
Profile* GetProfile( ProfileSlot slot ) { return (Profile*) ((const ProfileManager *) this)->GetProfile(slot); }
|
||||
CString GetProfileDir( ProfileSlot slot );
|
||||
CString GetProfileDir( ProfileSlot slot ) const;
|
||||
|
||||
Profile* GetMachineProfile() { return &m_MachineProfile; }
|
||||
|
||||
CString GetPlayerName( PlayerNumber pn );
|
||||
bool ProfileWasLoadedFromMemoryCard( PlayerNumber pn );
|
||||
CString GetPlayerName( PlayerNumber pn ) const;
|
||||
bool ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const;
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
bool IsSongNew( const Song* pSong ) const { return GetSongNumTimesPlayed(pSong,PROFILE_SLOT_MACHINE)==0; }
|
||||
void AddStepsHighScore( const Steps* pSteps, PlayerNumber pn, HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut );
|
||||
void IncrementStepsPlayCount( const Steps* pSteps, PlayerNumber pn );
|
||||
HighScore GetHighScoreForDifficulty( const Song *s, const StyleDef *st, ProfileSlot slot, Difficulty dc );
|
||||
HighScore GetHighScoreForDifficulty( const Song *s, const StyleDef *st, ProfileSlot slot, Difficulty dc ) const;
|
||||
|
||||
//
|
||||
// Course stats
|
||||
|
||||
Reference in New Issue
Block a user