working on hiding HighScore internals
This commit is contained in:
@@ -9,14 +9,22 @@
|
|||||||
#define EMPTY_NAME THEME->GetMetric ("HighScore","EmptyName")
|
#define EMPTY_NAME THEME->GetMetric ("HighScore","EmptyName")
|
||||||
|
|
||||||
|
|
||||||
|
struct HighScoreImpl
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
REGISTER_CLASS_TRAITS( HighScoreImpl, new HighScoreImpl(*pCopy) )
|
||||||
|
|
||||||
|
HighScore::HighScore()
|
||||||
|
{
|
||||||
|
m_Impl = new HighScoreImpl;
|
||||||
|
Unset();
|
||||||
|
}
|
||||||
|
|
||||||
bool HighScore::operator>=( const HighScore& other ) const
|
bool HighScore::operator>=( const HighScore& other ) const
|
||||||
{
|
{
|
||||||
/* Make sure we treat AAAA as higher than AAA, even though the score
|
/* Make sure we treat AAAA as higher than AAA, even though the score
|
||||||
* is the same.
|
* is the same. */
|
||||||
*
|
|
||||||
* XXX: Isn't it possible to beat the grade but not beat the score, since
|
|
||||||
* grading and scores are on completely different systems? Should we be
|
|
||||||
* checking for these completely separately? */
|
|
||||||
if( PREFSMAN->m_bPercentageScoring )
|
if( PREFSMAN->m_bPercentageScoring )
|
||||||
{
|
{
|
||||||
if( fPercentDP == other.fPercentDP )
|
if( fPercentDP == other.fPercentDP )
|
||||||
@@ -33,6 +41,29 @@ bool HighScore::operator>=( const HighScore& other ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HighScore::operator==( const HighScore& other ) const
|
||||||
|
{
|
||||||
|
#define COMPARE(x) if( x!=other.x ) return false;
|
||||||
|
COMPARE( sName );
|
||||||
|
COMPARE( grade );
|
||||||
|
COMPARE( iScore );
|
||||||
|
COMPARE( fPercentDP );
|
||||||
|
COMPARE( fSurviveSeconds );
|
||||||
|
COMPARE( sModifiers );
|
||||||
|
COMPARE( dateTime );
|
||||||
|
COMPARE( sPlayerGuid );
|
||||||
|
COMPARE( sMachineGuid );
|
||||||
|
COMPARE( iProductID );
|
||||||
|
FOREACH_TapNoteScore( tns )
|
||||||
|
COMPARE( iTapNoteScores[tns] );
|
||||||
|
FOREACH_HoldNoteScore( hns )
|
||||||
|
COMPARE( iHoldNoteScores[hns] );
|
||||||
|
COMPARE( radarValues );
|
||||||
|
COMPARE( fLifeRemainingSeconds );
|
||||||
|
#undef COMPARE
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
XNode* HighScore::CreateNode() const
|
XNode* HighScore::CreateNode() const
|
||||||
{
|
{
|
||||||
XNode* pNode = new XNode;
|
XNode* pNode = new XNode;
|
||||||
|
|||||||
@@ -7,9 +7,11 @@
|
|||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "RadarValues.h"
|
#include "RadarValues.h"
|
||||||
#include "DateTime.h"
|
#include "DateTime.h"
|
||||||
|
#include "RageUtil_AutoPtr.h"
|
||||||
|
|
||||||
struct XNode;
|
struct XNode;
|
||||||
|
|
||||||
|
struct HighScoreImpl;
|
||||||
struct HighScore
|
struct HighScore
|
||||||
{
|
{
|
||||||
CString sName; // name that shows in the machine's ranking screen
|
CString sName; // name that shows in the machine's ranking screen
|
||||||
@@ -27,7 +29,8 @@ struct HighScore
|
|||||||
RadarValues radarValues;
|
RadarValues radarValues;
|
||||||
float fLifeRemainingSeconds;
|
float fLifeRemainingSeconds;
|
||||||
|
|
||||||
HighScore() { Unset(); }
|
HighScore();
|
||||||
|
|
||||||
void Unset()
|
void Unset()
|
||||||
{
|
{
|
||||||
sName = "";
|
sName = "";
|
||||||
@@ -47,28 +50,7 @@ struct HighScore
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool operator>=( const HighScore& other ) const;
|
bool operator>=( const HighScore& other ) const;
|
||||||
bool operator==( const HighScore& other ) const
|
bool operator==( const HighScore& other ) const;
|
||||||
{
|
|
||||||
#define COMPARE(x) if( x!=other.x ) return false;
|
|
||||||
COMPARE( sName );
|
|
||||||
COMPARE( grade );
|
|
||||||
COMPARE( iScore );
|
|
||||||
COMPARE( fPercentDP );
|
|
||||||
COMPARE( fSurviveSeconds );
|
|
||||||
COMPARE( sModifiers );
|
|
||||||
COMPARE( dateTime );
|
|
||||||
COMPARE( sPlayerGuid );
|
|
||||||
COMPARE( sMachineGuid );
|
|
||||||
COMPARE( iProductID );
|
|
||||||
FOREACH_TapNoteScore( tns )
|
|
||||||
COMPARE( iTapNoteScores[tns] );
|
|
||||||
FOREACH_HoldNoteScore( hns )
|
|
||||||
COMPARE( iHoldNoteScores[hns] );
|
|
||||||
COMPARE( radarValues );
|
|
||||||
COMPARE( fLifeRemainingSeconds );
|
|
||||||
#undef COMPARE
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float GetSurvivalSeconds() { return fSurviveSeconds + fLifeRemainingSeconds; }
|
float GetSurvivalSeconds() { return fSurviveSeconds + fLifeRemainingSeconds; }
|
||||||
|
|
||||||
@@ -76,6 +58,8 @@ struct HighScore
|
|||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
|
|
||||||
CString GetDisplayName() const;
|
CString GetDisplayName() const;
|
||||||
|
private:
|
||||||
|
HiddenPtr<HighScoreImpl> m_Impl;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HighScoreList
|
struct HighScoreList
|
||||||
|
|||||||
Reference in New Issue
Block a user