本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: GetItemByPos
Item* Bag::GetItemByPos(uint8 slot) const {
if (slot < GetBagSize())
return m_bagslot[slot];
return NULL;
}