Skip to content

Commit

Permalink
Add a HasChartByHash function to Song
Browse files Browse the repository at this point in the history
  • Loading branch information
caiohsr14 committed Apr 1, 2018
1 parent 9ee6ac9 commit 0f80a8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,15 @@ bool Song::IsSkillsetHighestOfAnySteps(Skillset ss, float rate) {
return false;
}

bool Song::HasChartByHash(const string &hash) {
vector<Steps*> vsteps = GetAllSteps();
FOREACH(Steps*, vsteps, steps) {
if ((*steps)->GetChartKey() == hash)
return true;
}
return false;
}

RString Song::GetDisplayMainTitle() const
{
if(!PREFSMAN->m_bShowNativeLanguage) return GetTranslitMainTitle();
Expand Down
3 changes: 3 additions & 0 deletions src/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "RageTypes.h"
#include "Steps.h"
#include <set>
using std::string;

class Style;
class StepsID;
Expand Down Expand Up @@ -275,6 +276,8 @@ class Song
float GetHighestOfSkillsetAllSteps(int x, float rate) const;
bool IsSkillsetHighestOfAnySteps(Skillset ss, float rate);

bool HasChartByHash(const string &hash);

// For loading only:
bool m_bHasMusic, m_bHasBanner, m_bHasBackground;

Expand Down

0 comments on commit 0f80a8b

Please sign in to comment.