Skip to content

Commit

Permalink
add temporarily broken function
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jan 30, 2017
1 parent 4fa3d03 commit 0bd7207
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,23 @@ void Profile::GetScoresByKey(vector<SongID>& songids, vector<StepsID>& stepsids,
}
}

// new function that uses the chartkey indexed map
vector<HighScore> Profile::GetScoresByKey(RString ck) {
auto songids = SONGMAN->SongIDsByChartkey[ck];
auto stepsids = SONGMAN->StepsIDsByChartkey[ck];
vector<HighScore> o;

for (int i = 0; i < songids.size(); ++i) {
auto hsfas = m_SongHighScores[songids[i]].m_StepsHighScores;
vector<HighScore>& 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) {
Expand Down
4 changes: 4 additions & 0 deletions src/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<HighScore> GetScoresByKey(RString ck);

// Vector for now, we can make this more efficient later
vector<RString> FavoritedCharts;

Expand Down

0 comments on commit 0bd7207

Please sign in to comment.