diff --git a/src/HighScore.cpp b/src/HighScore.cpp index bbefef6bcb..ef20644f3f 100644 --- a/src/HighScore.cpp +++ b/src/HighScore.cpp @@ -587,8 +587,8 @@ bool HighScore::IsEmpty() const return true; } -RString HighScore::GetName() const { return m_Impl->sName; } -RString HighScore::GetChartKey() const { return m_Impl->ChartKey; } +string HighScore::GetName() const { return m_Impl->sName; } +string HighScore::GetChartKey() const { return m_Impl->ChartKey; } float HighScore::GetSSRCalcVersion() const { return m_Impl->SSRCalcVersion; } Grade HighScore::GetGrade() const { return m_Impl->grade; } unsigned int HighScore::GetScore() const { return m_Impl->iScore; } @@ -605,13 +605,13 @@ bool HighScore::GetChordCohesion() const { bool HighScore::GetEtternaValid() const { return m_Impl->bEtternaValid; } vector HighScore::GetOffsetVector() const { return m_Impl->vOffsetVector; } vector HighScore::GetNoteRowVector() const { return m_Impl->vNoteRowVector; } -RString HighScore::GetScoreKey() const { return m_Impl->ScoreKey; } +string HighScore::GetScoreKey() const { return m_Impl->ScoreKey; } float HighScore::GetSurviveSeconds() const { return m_Impl->fSurviveSeconds; } float HighScore::GetSurvivalSeconds() const { return GetSurviveSeconds() + GetLifeRemainingSeconds(); } -RString HighScore::GetModifiers() const { return m_Impl->sModifiers; } +string HighScore::GetModifiers() const { return m_Impl->sModifiers; } DateTime HighScore::GetDateTime() const { return m_Impl->dateTime; } -RString HighScore::GetPlayerGuid() const { return m_Impl->sPlayerGuid; } -RString HighScore::GetMachineGuid() const { return m_Impl->sMachineGuid; } +string HighScore::GetPlayerGuid() const { return m_Impl->sPlayerGuid; } +string HighScore::GetMachineGuid() const { return m_Impl->sMachineGuid; } int HighScore::GetProductID() const { return m_Impl->iProductID; } int HighScore::GetTapNoteScore( TapNoteScore tns ) const { return m_Impl->iTapNoteScores[tns]; } int HighScore::GetHoldNoteScore( HoldNoteScore hns ) const { return m_Impl->iHoldNoteScores[hns]; } @@ -620,8 +620,8 @@ const RadarValues &HighScore::GetRadarValues() const { return m_Impl->radarValue float HighScore::GetLifeRemainingSeconds() const { return m_Impl->fLifeRemainingSeconds; } bool HighScore::GetDisqualified() const { return m_Impl->bDisqualified; } -void HighScore::SetName( const RString &sName ) { m_Impl->sName = sName; } -void HighScore::SetChartKey( const RString &ck) { m_Impl->ChartKey = ck; } +void HighScore::SetName( const string &sName ) { m_Impl->sName = sName; } +void HighScore::SetChartKey( const string &ck) { m_Impl->ChartKey = ck; } void HighScore::SetSSRCalcVersion(float cv) { m_Impl->SSRCalcVersion = cv; } void HighScore::SetGrade( Grade g ) { m_Impl->grade = g; } void HighScore::SetScore( unsigned int iScore ) { m_Impl->iScore = iScore; } @@ -637,13 +637,13 @@ void HighScore::SetChordCohesion(bool b) { m_Impl->bNoChordCohesion = b; } void HighScore::SetEtternaValid(bool b) { m_Impl->bEtternaValid = b; } void HighScore::SetOffsetVector(const vector& v) { m_Impl->vOffsetVector = v; } void HighScore::SetNoteRowVector(const vector& v) { m_Impl->vNoteRowVector = v; } -void HighScore::SetScoreKey(const RString& sk) { m_Impl->ScoreKey = sk; } +void HighScore::SetScoreKey(const string& sk) { m_Impl->ScoreKey = sk; } void HighScore::SetRescoreJudgeVector(const vector& v) { m_Impl->vRescoreJudgeVector = v; } void HighScore::SetAliveSeconds( float f ) { m_Impl->fSurviveSeconds = f; } -void HighScore::SetModifiers( const RString &s ) { m_Impl->sModifiers = s; } +void HighScore::SetModifiers( const string &s ) { m_Impl->sModifiers = s; } void HighScore::SetDateTime( DateTime d ) { m_Impl->dateTime = d; } -void HighScore::SetPlayerGuid( const RString &s ) { m_Impl->sPlayerGuid = s; } -void HighScore::SetMachineGuid( const RString &s ) { m_Impl->sMachineGuid = s; } +void HighScore::SetPlayerGuid( const string &s ) { m_Impl->sPlayerGuid = s; } +void HighScore::SetMachineGuid( const string &s ) { m_Impl->sMachineGuid = s; } void HighScore::SetProductID( int i ) { m_Impl->iProductID = i; } void HighScore::SetTapNoteScore( TapNoteScore tns, int i ) { m_Impl->iTapNoteScores[tns] = i; } void HighScore::SetHoldNoteScore( HoldNoteScore hns, int i ) { m_Impl->iHoldNoteScores[hns] = i; } @@ -659,7 +659,7 @@ void HighScore::UnloadReplayData() { /* We normally don't give direct access to the members. We need this one * for NameToFillIn; use a special accessor so it's easy to find where this * is used. */ -RString *HighScore::GetNameMutable() { return &m_Impl->sName; } +string *HighScore::GetNameMutable() { return &m_Impl->sName; } bool HighScore::operator<(HighScore const& other) const { @@ -731,7 +731,7 @@ void HighScore::LoadFromEttNode(const XNode* pNode) m_Impl->LoadFromEttNode(pNode); } -RString HighScore::GetDisplayName() const +string HighScore::GetDisplayName() const { if( GetName().empty() ) return EMPTY_NAME; @@ -1050,7 +1050,7 @@ float HighScore::ConvertDpToWife() { class LunaHighScore: public Luna { public: - static int GetName( T* p, lua_State *L ) { lua_pushstring(L, p->GetName() ); return 1; } + static int GetName( T* p, lua_State *L ) { lua_pushstring(L, p->GetName().c_str()); return 1; } static int GetScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetScore() ); return 1; } static int GetPercentDP( T* p, lua_State *L ) { lua_pushnumber(L, p->GetPercentDP() ); return 1; } static int GetWifeScore(T* p, lua_State *L) { lua_pushnumber(L, p->GetWifeScore()); return 1; } @@ -1067,7 +1067,7 @@ class LunaHighScore: public Luna return 1; } static int GetMaxCombo( T* p, lua_State *L ) { lua_pushnumber(L, p->GetMaxCombo() ); return 1; } - static int GetModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->GetModifiers() ); return 1; } + static int GetModifiers( T* p, lua_State *L ) { lua_pushstring(L, p->GetModifiers().c_str() ); return 1; } static int GetTapNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTapNoteScore( Enum::Check(L, 1) ) ); return 1; } static int GetHoldNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetHoldNoteScore( Enum::Check(L, 1) ) ); return 1; } static int RescoreToWifeJudge(T* p, lua_State *L) { lua_pushnumber(L, p->RescoreToWifeJudge(IArg(1))); return 1; } diff --git a/src/HighScore.h b/src/HighScore.h index 38c5707a53..7b0f1d87bd 100644 --- a/src/HighScore.h +++ b/src/HighScore.h @@ -10,6 +10,8 @@ class XNode; struct RadarValues; struct lua_State; +using std::string; + struct HighScoreImpl; /** @brief The high score that is earned by a player. * @@ -21,8 +23,8 @@ struct HighScore /** * @brief Retrieve the name of the player that set the high score. * @return the name of the player. */ - RString GetName() const; - RString GetChartKey() const; + string GetName() const; + string GetChartKey() const; float GetSSRCalcVersion() const; /** * @brief Retrieve the grade earned from this score. @@ -48,7 +50,7 @@ struct HighScore bool GetEtternaValid() const; vector GetOffsetVector() const; vector GetNoteRowVector() const; - RString GetScoreKey() const; + string GetScoreKey() const; /** * @brief Determine how many seconds the player had left in Survival mode. * @return the number of seconds left. */ @@ -60,10 +62,10 @@ struct HighScore /** * @brief Get the modifiers used for this run. * @return the modifiers. */ - RString GetModifiers() const; + string GetModifiers() const; DateTime GetDateTime() const; - RString GetPlayerGuid() const; - RString GetMachineGuid() const; + string GetPlayerGuid() const; + string GetMachineGuid() const; int GetProductID() const; int GetTapNoteScore( TapNoteScore tns ) const; int GetHoldNoteScore( HoldNoteScore tns ) const; @@ -77,8 +79,8 @@ struct HighScore /** * @brief Set the name of the Player that earned the score. * @param sName the name of the Player. */ - void SetName( const RString &sName ); - void SetChartKey( const RString &ck ); + void SetName( const string &sName ); + void SetChartKey( const string &ck ); void SetSSRCalcVersion(float cv); void SetGrade( Grade g ); void SetScore( unsigned int iScore ); @@ -91,16 +93,16 @@ struct HighScore void SetEtternaValid(bool b); void SetOffsetVector(const vector& v); void SetNoteRowVector(const vector& v); - void SetScoreKey(const RString& ck); + void SetScoreKey(const string& ck); void SetRescoreJudgeVector(const vector& v); void SetAliveSeconds( float f ); void SetMaxCombo( unsigned int i ); void SetStageAward( StageAward a ); void SetPeakComboAward( PeakComboAward a ); - void SetModifiers( const RString &s ); + void SetModifiers( const string &s ); void SetDateTime( DateTime d ); - void SetPlayerGuid( const RString &s ); - void SetMachineGuid( const RString &s ); + void SetPlayerGuid( const string &s ); + void SetMachineGuid( const string &s ); void SetProductID( int i ); void SetTapNoteScore( TapNoteScore tns, int i ); void SetHoldNoteScore( HoldNoteScore tns, int i ); @@ -108,8 +110,8 @@ struct HighScore void SetLifeRemainingSeconds( float f ); void SetDisqualified( bool b ); - RString *GetNameMutable(); - const RString *GetNameMutable() const { return const_cast (const_cast(this)->GetNameMutable()); } + string *GetNameMutable(); + const string *GetNameMutable() const { return const_cast (const_cast(this)->GetNameMutable()); } void Unset(); @@ -130,7 +132,7 @@ struct HighScore bool HasReplayData(); void UnloadReplayData(); - RString GetDisplayName() const; + string GetDisplayName() const; // Mina stuff - Mina float RescoreToWifeJudge(int x);