本文整理汇总了C++中DiceRange::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ DiceRange::IsEmpty方法的具体用法?C++ DiceRange::IsEmpty怎么用?C++ DiceRange::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiceRange
的用法示例。
在下文中一共展示了DiceRange::IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadFromXML
ALERROR CSingleDevice::LoadFromXML (SDesignLoadCtx &Ctx, CXMLElement *pDesc)
// LoadFromXML
//
// Load from XML
{
ALERROR error;
// Load the item type
CString sUNID = pDesc->GetAttribute(DEVICE_ID_ATTRIB);
if (sUNID.IsBlank())
sUNID = pDesc->GetAttribute(ITEM_ATTRIB);
if (error = m_pItemType.LoadUNID(Ctx, sUNID))
return error;
if (m_pItemType.GetUNID() == 0)
{
Ctx.sError = strPatternSubst(CONSTLIT("<%s> element missing item attribute."), pDesc->GetTag());
return ERR_FAIL;
}
// Load the count
m_Count.LoadFromXML(pDesc->GetAttribute(COUNT_ATTRIB));
if (m_Count.IsEmpty())
m_Count.SetConstant(1);
// Load damage chance
m_iDamaged = pDesc->GetAttributeInteger(DAMAGED_ATTRIB);
// Load enhancement chance
if (error = m_Enhanced.InitFromXML(Ctx, pDesc))
return error;
// Load device position attributes
if (pDesc->FindAttributeInteger(POS_Z_ATTRIB, &m_iPosZ))
{
m_iPosAngle = pDesc->GetAttributeInteger(POS_ANGLE_ATTRIB);
m_iPosRadius = pDesc->GetAttributeInteger(POS_RADIUS_ATTRIB);
m_b3DPosition = true;
m_bDefaultPos = false;
}
else if (pDesc->FindAttributeInteger(POS_ANGLE_ATTRIB, &m_iPosAngle))
{
m_iPosRadius = pDesc->GetAttributeInteger(POS_RADIUS_ATTRIB);
m_iPosZ = 0;
m_b3DPosition = false;
m_bDefaultPos = false;
}
else
{
m_iPosAngle = 0;
m_iPosRadius = 0;
m_iPosZ = 0;
m_b3DPosition = false;
m_bDefaultPos = true;
}
// Load fire arc attributes
if (pDesc->FindAttributeInteger(MIN_FIRE_ARC_ATTRIB, &m_iMinFireArc))
{
m_bOmnidirectional = false;
m_iMaxFireArc = pDesc->GetAttributeInteger(MAX_FIRE_ARC_ATTRIB);
m_bDefaultFireArc = false;
}
else if (pDesc->FindAttributeBool(OMNIDIRECTIONAL_ATTRIB, &m_bOmnidirectional))
{
m_iMinFireArc = 0;
m_iMaxFireArc = 0;
m_bDefaultFireArc = false;
}
else
{
m_bOmnidirectional = false;
m_iMinFireArc = 0;
m_iMaxFireArc = 0;
m_bDefaultFireArc = true;
}
// Linked fire options
CString sLinkedFire;
if (pDesc->FindAttribute(LINKED_FIRE_ATTRIB, &sLinkedFire))
{
if (error = CDeviceClass::ParseLinkedFireOptions(Ctx, sLinkedFire, &m_dwLinkedFireOptions))
return error;
m_bDefaultLinkedFire = false;
}
else
{
m_dwLinkedFireOptions = 0;
m_bDefaultLinkedFire = true;
//.........这里部分代码省略.........