add judge counts to HighScore. Will this make Stats.xml too big?

This commit is contained in:
Chris Danford
2004-05-27 07:59:46 +00:00
parent 398865a5ec
commit 6a82d3c5a0
5 changed files with 68 additions and 30 deletions
+10
View File
@@ -109,6 +109,16 @@ static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = {
"Marvelous", "Marvelous",
}; };
XToString( TapNoteScore ); XToString( TapNoteScore );
StringToX( TapNoteScore );
static const CString HoldNoteScoreNames[NUM_HOLD_NOTE_SCORES] = {
"None",
"OK",
"NG",
};
XToString( HoldNoteScore );
StringToX( HoldNoteScore );
static const CString MemoryCardStateNames[NUM_MEMORY_CARD_STATES] = { static const CString MemoryCardStateNames[NUM_MEMORY_CARD_STATES] = {
+3 -6
View File
@@ -189,12 +189,7 @@ enum TapNoteScore {
}; };
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns ) #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
const CString& TapNoteScoreToString( TapNoteScore tns ); const CString& TapNoteScoreToString( TapNoteScore tns );
TapNoteScore StringToTapNoteScore( const CString& str );
//enum TapNoteTiming {
// TNT_NONE,
// TNT_EARLY,
// TNT_LATE
//};
enum HoldNoteScore enum HoldNoteScore
@@ -205,6 +200,8 @@ enum HoldNoteScore
NUM_HOLD_NOTE_SCORES NUM_HOLD_NOTE_SCORES
}; };
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns ) #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns )
const CString& HoldNoteScoreToString( HoldNoteScore tns );
HoldNoteScore StringToHoldNoteScore( const CString& str );
// //
+38 -23
View File
@@ -59,6 +59,15 @@ XNode* HighScore::CreateNode() const
pNode->AppendChild( "PlayerGuid", sPlayerGuid ); pNode->AppendChild( "PlayerGuid", sPlayerGuid );
pNode->AppendChild( "MachineGuid", sMachineGuid ); pNode->AppendChild( "MachineGuid", sMachineGuid );
pNode->AppendChild( "ProductID", iProductID ); pNode->AppendChild( "ProductID", iProductID );
XNode* pTapNoteScores = pNode->AppendChild( "TapNoteScores" );
FOREACH_TapNoteScore( tns )
pTapNoteScores->AppendChild( TapNoteScoreToString(tns), iTapNoteScores[tns] );
XNode* pHoldNoteScores = pNode->AppendChild( "HoldNoteScores" );
FOREACH_HoldNoteScore( hns )
pHoldNoteScores->AppendChild( HoldNoteScoreToString(hns), iHoldNoteScores[hns] );
XNode* pRadarCategories = pNode->AppendChild( "RadarActuals" );
FOREACH_RadarCategory( rc )
pRadarCategories->AppendChild( RadarCategoryToString(rc), fRadarActual[rc] );
return pNode; return pNode;
} }
@@ -66,30 +75,36 @@ XNode* HighScore::CreateNode() const
void HighScore::LoadFromNode( const XNode* pNode ) void HighScore::LoadFromNode( const XNode* pNode )
{ {
ASSERT( pNode->name == "HighScore" ); ASSERT( pNode->name == "HighScore" );
for( XNodes::const_iterator child = pNode->childs.begin();
child != pNode->childs.end(); CString s;
child++ )
{ pNode->GetChildValue( "Name", sName );
if( (*child)->name == "Name" ) (*child)->GetValue( sName ); pNode->GetChildValue( "Grade", s );
else if( (*child)->name == "Grade" ) /* Pre-a19 compatibility; remove eventually */
{ if( IsAnInt(s) )
CString sGrade; grade = (Grade) atoi( s );
(*child)->GetValue( sGrade );
/* Pre-a19 compatibility; remove eventually: */
if( IsAnInt(sGrade) )
grade = (Grade) atoi( sGrade );
else else
grade = StringToGrade( sGrade ); grade = StringToGrade( s );
} pNode->GetChildValue( "Score", iScore );
else if( (*child)->name == "Score" ) (*child)->GetValue( iScore ); pNode->GetChildValue( "PercentDP", fPercentDP );
else if( (*child)->name == "PercentDP" ) (*child)->GetValue( fPercentDP ); pNode->GetChildValue( "SurviveSeconds", fSurviveSeconds );
else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds ); pNode->GetChildValue( "Modifiers", sModifiers );
else if( (*child)->name == "Modifiers" ) (*child)->GetValue( sModifiers ); pNode->GetChildValue( "Time", (int&)time );
else if( (*child)->name == "Time" ) (*child)->GetValue( (int&)time ); pNode->GetChildValue( "PlayerGuid", sPlayerGuid );
else if( (*child)->name == "PlayerGuid" ) (*child)->GetValue( sPlayerGuid ); pNode->GetChildValue( "MachineGuid", sMachineGuid );
else if( (*child)->name == "MachineGuid" ) (*child)->GetValue( sMachineGuid ); pNode->GetChildValue( "ProductID", iProductID );
else if( (*child)->name == "ProductID" ) (*child)->GetValue( iProductID ); XNode* pTapNoteScores = pNode->GetChild( "TapNoteScores" );
} if( pTapNoteScores )
FOREACH_TapNoteScore( tns )
pTapNoteScores->GetChildValue( TapNoteScoreToString(tns), iTapNoteScores[tns] );
XNode* pHoldNoteScores = pNode->GetChild( "HoldNoteScores" );
if( pHoldNoteScores )
FOREACH_HoldNoteScore( hns )
pHoldNoteScores->GetChildValue( HoldNoteScoreToString(hns), iHoldNoteScores[hns] );
XNode* pRadarCategories = pNode->GetChild( "RadarActuals" );
if( pRadarCategories )
FOREACH_RadarCategory( rc )
pRadarCategories->GetChildValue( RadarCategoryToString(rc), fRadarActual[rc] );
/* Validate input. */ /* Validate input. */
grade = clamp( grade, GRADE_TIER_1, GRADE_FAILED ); grade = clamp( grade, GRADE_TIER_1, GRADE_FAILED );
+13
View File
@@ -13,6 +13,7 @@
*/ */
#include "Grade.h" #include "Grade.h"
#include "GameConstantsAndTypes.h"
struct XNode; struct XNode;
struct HighScore struct HighScore
@@ -27,6 +28,9 @@ struct HighScore
CString sPlayerGuid; // who made this high score CString sPlayerGuid; // who made this high score
CString sMachineGuid; // where this high score was made CString sMachineGuid; // where this high score was made
int iProductID; int iProductID;
int iTapNoteScores[NUM_TAP_NOTE_SCORES];
int iHoldNoteScores[NUM_HOLD_NOTE_SCORES];
float fRadarActual[NUM_RADAR_CATEGORIES];
HighScore() { Unset(); } HighScore() { Unset(); }
void Unset() void Unset()
@@ -41,6 +45,9 @@ struct HighScore
sPlayerGuid = ""; sPlayerGuid = "";
sMachineGuid = ""; sMachineGuid = "";
iProductID = 0; iProductID = 0;
ZERO( iTapNoteScores );
ZERO( iHoldNoteScores );
ZERO( fRadarActual );
} }
bool operator>=( const HighScore& other ) const; bool operator>=( const HighScore& other ) const;
@@ -57,6 +64,12 @@ struct HighScore
COMPARE( sPlayerGuid ); COMPARE( sPlayerGuid );
COMPARE( sMachineGuid ); COMPARE( sMachineGuid );
COMPARE( iProductID ); COMPARE( iProductID );
FOREACH_TapNoteScore( tns )
COMPARE( iTapNoteScores[tns] );
FOREACH_HoldNoteScore( hns )
COMPARE( iHoldNoteScores[hns] );
FOREACH_RadarCategory( rc )
COMPARE( fRadarActual[rc] );
#undef COMPARE #undef COMPARE
return true; return true;
} }
+3
View File
@@ -899,6 +899,9 @@ void ScreenEvaluation::CommitScores(
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : ""; hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
hs.iProductID = PREFSMAN->m_iProductID; hs.iProductID = PREFSMAN->m_iProductID;
memcpy( hs.iTapNoteScores, stageStats.iTapNoteScores[p], sizeof(hs.iTapNoteScores) );
memcpy( hs.iHoldNoteScores, stageStats.iHoldNoteScores[p], sizeof(hs.iHoldNoteScores) );
memcpy( hs.fRadarActual, stageStats.fRadarActual[p], sizeof(hs.fRadarActual) );
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType; StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;