本文整理汇总了C++中XNode::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ XNode::SetValue方法的具体用法?C++ XNode::SetValue怎么用?C++ XNode::SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XNode
的用法示例。
在下文中一共展示了XNode::SetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendChild
XNode *XNode::AppendChild( const char* name, const DateTime &value ) { XNode *p = new XNode; p->m_sName = name; p->SetValue( value ); return AppendChild( p ); }
示例2: SaveGeneralDataCreateNode
XNode* Profile::SaveGeneralDataCreateNode() const
{
XNode* pGeneralDataNode = new XNode;
pGeneralDataNode->name = "GeneralData";
// TRICKY: These are write-only elements that are never read again. This
// data is required by other apps (like internet ranking), but is
// redundant to the game app.
pGeneralDataNode->AppendChild( "DisplayName", GetDisplayName() );
pGeneralDataNode->AppendChild( "IsMachine", IsMachine() );
pGeneralDataNode->AppendChild( "Guid", m_sGuid );
pGeneralDataNode->AppendChild( "UsingProfileDefaultModifiers", m_bUsingProfileDefaultModifiers );
pGeneralDataNode->AppendChild( "DefaultModifiers", m_sDefaultModifiers );
pGeneralDataNode->AppendChild( "SortOrder", SortOrderToString(m_SortOrder) );
pGeneralDataNode->AppendChild( "LastDifficulty", DifficultyToString(m_LastDifficulty) );
pGeneralDataNode->AppendChild( "LastCourseDifficulty", CourseDifficultyToString(m_LastCourseDifficulty) );
pGeneralDataNode->AppendChild( m_lastSong.CreateNode() );
pGeneralDataNode->AppendChild( m_lastCourse.CreateNode() );
pGeneralDataNode->AppendChild( "TotalPlays", m_iTotalPlays );
pGeneralDataNode->AppendChild( "TotalPlaySeconds", m_iTotalPlaySeconds );
pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo );
pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
pGeneralDataNode->AppendChild( "LastPlayedDate", m_LastPlayedDate );
pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints );
pGeneralDataNode->AppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed );
pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed );
pGeneralDataNode->AppendChild( "NumToasties", m_iNumToasties );
pGeneralDataNode->AppendChild( "TotalTapsAndHolds", m_iTotalTapsAndHolds );
pGeneralDataNode->AppendChild( "TotalJumps", m_iTotalJumps );
pGeneralDataNode->AppendChild( "TotalHolds", m_iTotalHolds );
pGeneralDataNode->AppendChild( "TotalMines", m_iTotalMines );
pGeneralDataNode->AppendChild( "TotalHands", m_iTotalHands );
// Keep declared variables in a very local scope so they aren't
// accidentally used where they're not intended. There's a lot of
// copying and pasting in this code.
{
XNode* pUnlockedSongs = pGeneralDataNode->AppendChild("UnlockedSongs");
for( set<int>::const_iterator it = m_UnlockedSongs.begin(); it != m_UnlockedSongs.end(); ++it )
pUnlockedSongs->AppendChild( ssprintf("Unlock%i", *it) );
}
{
XNode* pNumSongsPlayedByPlayMode = pGeneralDataNode->AppendChild("NumSongsPlayedByPlayMode");
FOREACH_PlayMode( pm )
{
/* Don't save unplayed PlayModes. */
if( !m_iNumSongsPlayedByPlayMode[pm] )
continue;
pNumSongsPlayedByPlayMode->AppendChild( PlayModeToString(pm), m_iNumSongsPlayedByPlayMode[pm] );
}
}
{
XNode* pNumSongsPlayedByStyle = pGeneralDataNode->AppendChild("NumSongsPlayedByStyle");
for( map<StyleID,int>::const_iterator iter = m_iNumSongsPlayedByStyle.begin();
iter != m_iNumSongsPlayedByStyle.end();
iter++ )
{
const StyleID &s = iter->first;
int iNumPlays = iter->second;
XNode *pStyleNode = s.CreateNode();
pStyleNode->SetValue( iNumPlays );
pNumSongsPlayedByStyle->AppendChild( pStyleNode );
}
}
{
XNode* pNumSongsPlayedByDifficulty = pGeneralDataNode->AppendChild("NumSongsPlayedByDifficulty");
FOREACH_Difficulty( dc )
{
if( !m_iNumSongsPlayedByDifficulty[dc] )
continue;
pNumSongsPlayedByDifficulty->AppendChild( DifficultyToString(dc), m_iNumSongsPlayedByDifficulty[dc] );
}
}
{
XNode* pNumSongsPlayedByMeter = pGeneralDataNode->AppendChild("NumSongsPlayedByMeter");
for( int i=0; i<MAX_METER+1; i++ )
{
if( !m_iNumSongsPlayedByMeter[i] )
continue;
pNumSongsPlayedByMeter->AppendChild( ssprintf("Meter%d",i), m_iNumSongsPlayedByMeter[i] );
}
}
{
XNode* pNumStagesPassedByGrade = pGeneralDataNode->AppendChild("NumStagesPassedByGrade");
FOREACH_Grade( g )
{
if( !m_iNumStagesPassedByGrade[g] )
continue;
pNumStagesPassedByGrade->AppendChild( GradeToString(g), m_iNumStagesPassedByGrade[g] );
//.........这里部分代码省略.........
示例3: AppendChild
XNode *XNode::AppendChild( const char* name, int value ) { XNode *p = new XNode; p->name = name; p->SetValue( value ); return AppendChild( p ); }