save HighScore in Screenshot

This commit is contained in:
Chris Danford
2004-06-12 07:01:07 +00:00
parent 3bc4cbf9a4
commit 4fb496e4d9
7 changed files with 51 additions and 47 deletions
+24
View File
@@ -189,6 +189,30 @@ void HighScoreList::LoadFromNode( const XNode* pNode )
}
}
XNode* Screenshot::CreateNode() const
{
XNode* pNode = new XNode;
pNode->name = "Screenshot";
// TRICKY: Don't write "name to fill in" markers.
pNode->AppendChild( "FileName", sFileName );
pNode->AppendChild( "MD5", sMD5 );
pNode->AppendChild( highScore.CreateNode() );
return pNode;
}
void Screenshot::LoadFromNode( const XNode* pNode )
{
ASSERT( pNode->name == "Screenshot" );
pNode->GetChildValue( "FileName", sFileName );
pNode->GetChildValue( "MD5", sMD5 );
XNode* pHighScore = pNode->GetChild( "HighScore" );
if( pHighScore )
highScore.LoadFromNode( pHighScore );
}
/*
* (c) 2004 Chris Danford
* All rights reserved.