Add operator== and operator!= as well as getting all matching steps for a particular song.
This commit is contained in:
@@ -29,13 +29,22 @@ public:
|
||||
}
|
||||
|
||||
bool Matches( const Song *pSong, const Steps *pSteps ) const;
|
||||
bool operator==( const StepsCriteria &other ) const
|
||||
{
|
||||
#define X(x) (x == other.x)
|
||||
return X(m_difficulty) && X(m_iLowMeter) && X(m_iHighMeter) && X(m_st) && X(m_Locked);
|
||||
#undef X
|
||||
}
|
||||
bool operator!=( const StepsCriteria &other ) const { return !operator==( other ); }
|
||||
};
|
||||
|
||||
class SongAndSteps
|
||||
{
|
||||
public:
|
||||
Song* pSong;
|
||||
Steps* pSteps;
|
||||
Song *pSong;
|
||||
Steps *pSteps;
|
||||
SongAndSteps() : pSong(NULL), pSteps(NULL) { }
|
||||
SongAndSteps( Song *pSong_, Steps *pSteps_ ) : pSong(pSong_), pSteps(pSteps_) { }
|
||||
bool operator==( const SongAndSteps& other ) const { return pSong==other.pSong && pSteps==other.pSteps; }
|
||||
bool operator<( const SongAndSteps& other ) const { return pSong<=other.pSong && pSteps<=other.pSteps; }
|
||||
};
|
||||
@@ -43,6 +52,7 @@ public:
|
||||
namespace StepsUtil
|
||||
{
|
||||
void GetAllMatching( const SongCriteria &soc, const StepsCriteria &stc, vector<SongAndSteps> &out ); // look up in SONGMAN
|
||||
void GetAllMatching( Song *pSong, const StepsCriteria &stc, vector<SongAndSteps> &out );
|
||||
|
||||
bool CompareNotesPointersByRadarValues(const Steps* pSteps1, const Steps* pSteps2);
|
||||
bool CompareNotesPointersByMeter(const Steps *pSteps1, const Steps* pSteps2);
|
||||
|
||||
Reference in New Issue
Block a user