Attack::operator==, TrailEntry::operator==
This commit is contained in:
@@ -26,3 +26,15 @@ void Attack::GetAttackBeats( const Song *song, PlayerNumber pn, float &fStartBea
|
||||
|
||||
RAGE_ASSERT_M( fEndBeat >= fStartBeat, ssprintf("%f >= %f", fEndBeat, fStartBeat) );
|
||||
}
|
||||
|
||||
bool Attack::operator== ( const Attack &rhs ) const
|
||||
{
|
||||
#define EQUAL(a) (a==rhs.a)
|
||||
return
|
||||
EQUAL(level) &&
|
||||
EQUAL(fStartSecond) &&
|
||||
EQUAL(fSecsRemaining) &&
|
||||
EQUAL(sModifier) &&
|
||||
EQUAL(bOn) &&
|
||||
EQUAL(bGlobal);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ struct Attack
|
||||
bool IsBlank() { return sModifier.empty(); }
|
||||
void MakeBlank() { sModifier=""; }
|
||||
Attack() { fStartSecond = -1; bOn = false; bGlobal = false; }
|
||||
bool operator== ( const Attack &rhs ) const;
|
||||
};
|
||||
typedef vector<Attack> AttackArray;
|
||||
|
||||
|
||||
@@ -32,6 +32,20 @@ void TrailEntry::GetAttackArray( AttackArray &out ) const
|
||||
out.insert( out.end(), Attacks.begin(), Attacks.end() );
|
||||
}
|
||||
|
||||
bool TrailEntry::operator== ( const TrailEntry &rhs ) const
|
||||
{
|
||||
#define EQUAL(a) (a==rhs.a)
|
||||
return
|
||||
EQUAL(pSong) &&
|
||||
EQUAL(pSteps) &&
|
||||
EQUAL(Modifiers) &&
|
||||
EQUAL(Attacks) &&
|
||||
EQUAL(bMystery) &&
|
||||
EQUAL(iLowMeter) &&
|
||||
EQUAL(iHighMeter) &&
|
||||
EQUAL(dc);
|
||||
}
|
||||
|
||||
RadarValues Trail::GetRadarValues() const
|
||||
{
|
||||
RadarValues rv;
|
||||
|
||||
@@ -40,6 +40,8 @@ struct TrailEntry
|
||||
int iLowMeter;
|
||||
int iHighMeter;
|
||||
Difficulty dc;
|
||||
bool operator== ( const TrailEntry &rhs ) const;
|
||||
bool operator!= ( const TrailEntry &rhs ) const { return !(*this==rhs); }
|
||||
};
|
||||
|
||||
class Trail
|
||||
|
||||
Reference in New Issue
Block a user