本文整理汇总了C++中CItemContainer::IsType方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemContainer::IsType方法的具体用法?C++ CItemContainer::IsType怎么用?C++ CItemContainer::IsType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemContainer
的用法示例。
在下文中一共展示了CItemContainer::IsType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsItemInTrade
bool CItemContainer::IsItemInTrade()
{
// recursively get the item that is at "top" level.
CItemContainer * pObj = (dynamic_cast <CItemContainer*>(this));
//const CObjBase* pObj = pItem->GetContainer();
if ( !pObj )
return false;
else if (pObj->IsType( IT_EQ_TRADE_WINDOW ))
return true;
CItemContainer * pObj2 = (dynamic_cast <CItemContainer*>(this->GetContainer()));
return pObj2->IsItemInTrade();
}
示例2: ContentConsume
int CContainer::ContentConsume( RESOURCE_ID_BASE rid, int amount, bool fTest, DWORD dwArg )
{
ADDTOCALLSTACK("CContainer::ContentConsume");
// ARGS:
// dwArg = a hack for ores.
// RETURN:
// 0 = all consumed ok.
// # = number left to be consumed. (still required)
if ( rid.GetResIndex() == 0 )
return( amount ); // from skills menus.
CItem * pItemNext;
for ( CItem* pItem=GetContentHead(); pItem!=NULL; pItem=pItemNext)
{
pItemNext = pItem->GetNext();
if ( pItem->IsResourceMatch( rid, dwArg ))
{
amount -= pItem->ConsumeAmount( amount, fTest );
if ( amount <= 0 )
break;
}
CItemContainer * pCont = dynamic_cast <CItemContainer*> (pItem);
if ( pCont != NULL ) // this is a sub-container.
{
if ( rid == RESOURCE_ID(RES_TYPEDEF,IT_GOLD))
{
if ( pCont->IsType(IT_CONTAINER_LOCKED))
continue;
}
else
{
if ( ! pCont->IsSearchable())
continue;
}
amount = pCont->ContentConsume( rid, amount, fTest, dwArg );
if ( amount <= 0 )
break;
}
}
return( amount );
}