From 0bd7207ef1cfa25d29efe903b0cea693f68c3fe9 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sun, 29 Jan 2017 19:04:52 -0500 Subject: [PATCH] add temporarily broken function --- src/Profile.cpp | 17 +++++++++++++++++ src/Profile.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/src/Profile.cpp b/src/Profile.cpp index 871c78da32..87639b288c 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -2074,6 +2074,23 @@ void Profile::GetScoresByKey(vector& songids, vector& stepsids, } } +// new function that uses the chartkey indexed map +vector Profile::GetScoresByKey(RString ck) { + auto songids = SONGMAN->SongIDsByChartkey[ck]; + auto stepsids = SONGMAN->StepsIDsByChartkey[ck]; + vector o; + + for (int i = 0; i < songids.size(); ++i) { + auto hsfas = m_SongHighScores[songids[i]].m_StepsHighScores; + vector& scores = hsfas[stepsids[i]].hsl.vHighScores; + for (int ii = 0; ii < scores.size(); ++ii) { + o.emplace_back(scores[ii]); + } + } + + return o; +} + float Profile::GetWifePBByKey(RString key) { float o = 0.f; FOREACHM_CONST(SongID, HighScoresForASong, m_SongHighScores, i) { diff --git a/src/Profile.h b/src/Profile.h index 629e1e287b..064eea657c 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -250,6 +250,10 @@ class Profile void AddToFavorites(RString ck) { FavoritedCharts.emplace_back(ck); } void RemoveFromFavorites(RString ck); + + // doesn't work properly yet - mina + vector GetScoresByKey(RString ck); + // Vector for now, we can make this more efficient later vector FavoritedCharts;