本文整理汇总了C++中CItem::IsItemEquipped方法的典型用法代码示例。如果您正苦于以下问题:C++ CItem::IsItemEquipped方法的具体用法?C++ CItem::IsItemEquipped怎么用?C++ CItem::IsItemEquipped使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItem
的用法示例。
在下文中一共展示了CItem::IsItemEquipped方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPropertyNum
void CCPropsItemChar::SetPropertyNum(int iPropIndex, PropertyValNum_t iVal, CObjBase* pLinkedObj, RESDISPLAY_VERSION iLimitToExpansion, bool fDeleteZero)
{
ADDTOCALLSTACK("CCPropsItemChar::SetPropertyNum");
ASSERT(!IsPropertyStr(iPropIndex));
ASSERT((iLimitToExpansion >= RDS_PRET2A) && (iLimitToExpansion < RDS_QTY));
if ((fDeleteZero && (iVal == 0)) || (_iPropertyExpansion[iPropIndex] > iLimitToExpansion))
{
if (0 == _mPropsNum.erase(iPropIndex))
return; // I didn't have this property, so avoid further processing.
}
else
_mPropsNum[iPropIndex] = iVal;
if (!pLinkedObj)
return;
// Do stuff to the pLinkedObj
switch (iPropIndex)
{
case PROPITCH_WEIGHTREDUCTION:
{
CItem *pItemLink = static_cast<CItem*>(pLinkedObj);
int oldweight = pItemLink->GetWeight();
CContainer * pCont = dynamic_cast <CContainer*> (pItemLink->GetParent());
if (pCont)
{
ASSERT(pItemLink->IsItemEquipped() || pItemLink->IsItemInContainer());
pCont->OnWeightChange(pItemLink->GetWeight() - oldweight);
pLinkedObj->UpdatePropertyFlag();
}
break;
}
//default:
// pLinkedObj->UpdatePropertyFlag();
// break;
}
}
示例2: ImportFix
void CImportFile::ImportFix()
{
ADDTOCALLSTACK("CImportFile::ImportFix");
// adjust all the containered items and eliminate duplicates.
CheckLast();
int iRemoved = 0;
CImportSer * pSerNext;
m_pCurSer = static_cast <CImportSer*> ( m_ListSer.GetHead());
for ( ; m_pCurSer != NULL; m_pCurSer = pSerNext )
{
pSerNext = static_cast <CImportSer*> ( m_pCurSer->GetNext());
if ( m_pCurSer->m_pObj == NULL ) // NEver created correctly
{
delete m_pCurSer;
continue;
}
// Make sure this item is not a dupe ?
CItem * pItemTest;
if ( m_pCurSer->IsTopLevel()) // top level only
{
if ( m_pCurSer->m_pObj->IsItem())
{
CItem * pItemCheck = dynamic_cast <CItem*>( m_pCurSer->m_pObj );
ASSERT(pItemCheck);
pItemCheck->SetAttr(ATTR_MOVE_NEVER);
CWorldSearch AreaItems( m_pCurSer->m_pObj->GetTopPoint());
for (;;)
{
CItem * pItem = AreaItems.GetItem();
if ( pItem == NULL )
break;
if ( ! pItem->IsSameType( m_pCurSer->m_pObj ))
continue;
pItem->SetName( m_pCurSer->m_pObj->GetName());
if ( ! ( m_pCurSer->m_pObj->GetTopZ() == pItem->GetTopZ()))
continue;
goto item_delete;
}
}
else
{
// dupe char ?
}
// Make sure the top level object is placed correctly.
m_pCurSer->m_pObj->MoveTo( m_pCurSer->m_pObj->GetTopPoint());
m_pCurSer->m_pObj->Update();
if ( ! m_pCurSer->m_pObj->IsContainer())
delete m_pCurSer;
continue;
}
pItemTest = dynamic_cast <CItem*> (m_pCurSer->m_pObj);
if ( pItemTest == NULL )
{
item_delete:
delete m_pCurSer->m_pObj;
delete m_pCurSer;
iRemoved ++;
continue;
}
// Find it's container.
CImportSer* pSerCont = static_cast <CImportSer*> ( m_ListSer.GetHead());
CObjBase * pObjCont = NULL;
for ( ; pSerCont != NULL; pSerCont = static_cast <CImportSer*> ( pSerCont->GetNext()))
{
if ( pSerCont->m_pObj == NULL )
continue;
if ( pSerCont->m_dwSer == m_pCurSer->m_dwContSer )
{
pObjCont = pSerCont->m_pObj;
if ( ! pItemTest->LoadSetContainer( pObjCont->GetUID(), m_pCurSer->m_layer ))
{
goto item_delete; // not in a cont ?
}
m_pCurSer->m_dwContSer = UID_UNUSED; // found it.
break;
}
}
if ( ! m_pCurSer->IsTopLevel() || pObjCont == NULL)
{
goto item_delete;
}
// Is it a dupe in the container or equipped ?
for ( CItem *pItem = dynamic_cast<CContainer*>(pObjCont)->GetContentHead(); pItem != NULL; pItem = pItem->GetNext() )
{
if ( pItemTest == pItem )
continue;
if ( pItemTest->IsItemEquipped())
{
if ( pItemTest->GetEquipLayer() != pItem->GetEquipLayer())
continue;
//.........这里部分代码省略.........