From fb7553a2c02097924c16e6f206b1526701ae78b5 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 5 May 2007 11:16:07 +0000 Subject: [PATCH] Add GetGradeForTrail(). --- stepmania/src/ProfileManager.cpp | 8 ++++++++ stepmania/src/ProfileManager.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 500a890496..d4219bef19 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -679,6 +679,14 @@ Grade ProfileManager::GetGradeForSteps( const Song *pSong, const Style *st, Prof return Grade_NoData; } +Grade ProfileManager::GetGradeForTrail( const Course *pCourse, const Style *st, ProfileSlot slot, Difficulty dc ) const +{ + const Trail *pTrail = pCourse->GetTrail( st->m_StepsType, dc ); + + if( pTrail && IsPersistentProfile(slot) ) + return GetProfile( slot )->GetCourseHighScoreList( pCourse, pTrail ).HighGrade; + return Grade_NoData; +} // // Course stats diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index 124b830a8a..bf5b2d3cf8 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -101,7 +101,7 @@ public: // void AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs, int &iPersonalIndexOut, int &iMachineIndexOut ); void IncrementCoursePlayCount( const Course* pCourse, const Trail* pTrail, PlayerNumber pn ); - + Grade GetGradeForTrail( const Course *pCourse, const Style *st, ProfileSlot slot, Difficulty dc ) const; // // Category stats //