本文整理汇总了C++中Condition::XmlSetExpect方法的典型用法代码示例。如果您正苦于以下问题:C++ Condition::XmlSetExpect方法的具体用法?C++ Condition::XmlSetExpect怎么用?C++ Condition::XmlSetExpect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Condition
的用法示例。
在下文中一共展示了Condition::XmlSetExpect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadEffectInfo
//.........这里部分代码省略.........
else if( 0 == xmlStrcmp( str, BAD_CAST"CRIT" ) )
{
pEffect = new EModCrit();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"ATK" ) )
{
pEffect = new EModAtk();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"ASPD" ) )
{
pEffect = new EModAspd();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"MP" ) )
{
pEffect = new EModMp();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"EVAD" ) )
{
pEffect = new EModEvad();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"BLOCK" ) )
{
pEffect = new EModBlock();
}
else
{
xmlFree(str);
nodeEffect = nodeEffect->next;
continue;
}
}
xmlFree(str);
if( !pEffect )
{
DEBUG_LOG( "Malloc Effect Object Failed" );
nodeEffect = nodeEffect->next;
continue;
}
m_vecEffect.push_back( pEffect );
uint32_t ID;
DECODE_XML_PROP_INT( ID, nodeEffect, "ID" );
if( ID != m_vecEffect.size() - 1 )
{
ERROR_LOG( "Effect ID Invalid The Value is:[%d] Expect:[%lu]", ID, m_vecEffect.size() - 1 );
}
str = xmlGetProp( nodeEffect, BAD_CAST"Value" );
pEffect->XmlSetEffect( (char*)str );
xmlFree(str);
xmlNodePtr child = nodeEffect->xmlChildrenNode;
Condition* pCond = NULL;
while( child )
{
if( 0 == xmlStrcmp( child->name, BAD_CAST"Condition" ) )
{
str = xmlGetProp( child, BAD_CAST"Type" );
if( str )
{
if( 0 == xmlStrcmp( str, BAD_CAST"HP" ) )
{
pCond = new CondHP();
}
else if( 0 == xmlStrcmp( str, BAD_CAST"RAND" ) )
{
pCond = new CondRand();
}
else
{
child = child->next;
xmlFree(str);
continue;
}
}
xmlFree(str);
if( !pCond )
{
DEBUG_LOG( "Malloc Condition Object Failed" );
child = child->next;
continue;
}
pEffect->AddCondition( pCond );
str = xmlGetProp( child, BAD_CAST"Except" );
pCond->XmlSetExpect( (char*)str );
xmlFree(str);
}
child = child->next;
}
}
nodeEffect = nodeEffect->next;
}
exit:
xmlFreeDoc(doc);
DEBUG_LOG( "Load Effect Info Over Effect Size Is:[%lu]", m_vecEffect.size() );
return ret;
}