Skip to content

Commit

Permalink
clean up some code related to the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 5, 2017
1 parent 27b97b2 commit 6140fd2
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,38 +723,26 @@ bool SongManager::IsGroupNeverCached(const RString& group) const
}

void SongManager::SetFavoritedStatus(set<string>& favs) {
FOREACH(Song*, m_pSongs, song) {
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) {
RString sck = (*steps)->GetChartKey();
FOREACHS(string, favs, ck)
if (sck == *ck)
(*song)->SetFavorited(true);
}
}
FOREACH(Song*, m_pSongs, song)
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps)
if (favs.count((*steps)->GetChartKey()))
(*song)->SetFavorited(true);
}

void SongManager::SetPermaMirroredStatus(set<string>& pmir) {
FOREACH(Song*, m_pSongs, song) {
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) {
RString sck = (*steps)->GetChartKey();
FOREACHS(string, pmir, ck)
if (sck == *ck)
(*song)->SetPermaMirror(true);
}
}
FOREACH(Song*, m_pSongs, song)
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps)
if (pmir.count((*steps)->GetChartKey()))
(*song)->SetPermaMirror(true);
}

// hurr should probably redo both (all three) of these -mina
void SongManager::SetHasGoal(map<RString, vector<ScoreGoal>> goalmap) {
FOREACH(Song*, m_pSongs, song) {
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) {
RString sck = (*steps)->GetChartKey();
auto it = goalmap.find(sck);
if(it != goalmap.end())
FOREACH(Song*, m_pSongs, song)
FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps)
if(goalmap.count((*steps)->GetChartKey()))
(*song)->SetHasGoal(true);
}
}
}
}

RString SongManager::GetSongGroupBannerPath( const RString &sSongGroup ) const
{
Expand Down

0 comments on commit 6140fd2

Please sign in to comment.