當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetBagSize函數代碼示例

本文整理匯總了C++中GetBagSize函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetBagSize函數的具體用法?C++ GetBagSize怎麽用?C++ GetBagSize使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetBagSize函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetFreeSlots

uint32 Bag::GetFreeSlots() const
{
    uint32 slots = 0;
    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (!m_bagslot[i])
            ++slots;

    return slots;
}
開發者ID:madbhr,項目名稱:blizzlikecore,代碼行數:9,代碼來源:Bag.cpp

示例2: GetSlotByItemGUID

uint8 Bag::GetSlotByItemGUID(ObjectGuid guid) const
{
    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i] != 0)
            if (m_bagslot[i]->GetObjectGuid() == guid)
                return i;

    return NULL_SLOT;
}
開發者ID:madbhr,項目名稱:blizzlikecore,代碼行數:9,代碼來源:Bag.cpp

示例3: GetItemCount

uint32 Bag::GetItemCount(uint32 item, Item* eItem) const {
	Item *pItem;
	uint32 count = 0;
	for (uint32 i = 0; i < GetBagSize(); ++i) {
		pItem = m_bagslot[i];
		if (pItem && pItem != eItem && pItem->GetEntry() == item)
			count += pItem->GetCount();
	}

	if (eItem && eItem->GetProto()->GemProperties) {
		for (uint32 i = 0; i < GetBagSize(); ++i) {
			pItem = m_bagslot[i];
			if (pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color)
				count += pItem->GetGemCountWithID(item);
		}
	}

	return count;
}
開發者ID:Bootz,項目名稱:DeepshjirRepack,代碼行數:19,代碼來源:Bag.cpp

示例4: GetItemCountWithLimitCategory

uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory) const
{
    uint32 count = 0;
    for(uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i])
            if (m_bagslot[i]->GetProto()->ItemLimitCategory == limitCategory )
                count += m_bagslot[i]->GetCount();

    return count;
}
開發者ID:Archives,項目名稱:try,代碼行數:10,代碼來源:Bag.cpp

示例5: GetItemCount

uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
{
    uint32 count = 0;

    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i])
            if (m_bagslot[i] != eItem && m_bagslot[i]->GetEntry() == item)
                count += m_bagslot[i]->GetCount();

    return count;
}
開發者ID:cala,項目名稱:mangos-classic,代碼行數:11,代碼來源:Bag.cpp

示例6: GetItemCount

uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
{
    Item *pItem;
    uint32 count = 0;
    for(uint32 i=0; i < GetBagSize(); ++i)
    {
        pItem = m_bagslot[i];
        if( pItem && pItem != eItem && pItem->GetEntry() == item )
            count += pItem->GetCount();
    }

    return count;
}
開發者ID:FoOtY,項目名稱:ClassyWoW,代碼行數:13,代碼來源:Bag.cpp

示例7: GetItemByPos

Item* Bag::GetItemByPos(uint8 slot) const {
	if (slot < GetBagSize())
		return m_bagslot[slot];

	return NULL;
}
開發者ID:Bootz,項目名稱:DeepshjirRepack,代碼行數:6,代碼來源:Bag.cpp


注:本文中的GetBagSize函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。