DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetNumberOfItems()

int InventoryItem::GetNumberOfItems ( )
inlineprotected

Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.

См. определение в файле ItemBase.c строка 3572

3573 {
3574 int item_count = 0;
3575 ItemBase item;
3576
3577 GameInventory inventory = GetInventory();
3578 CargoBase cargo = inventory.GetCargo();
3579 if (cargo != NULL)
3580 {
3581 item_count = cargo.GetItemCount();
3582 }
3583
3584 int nAttachments = inventory.AttachmentCount();
3585 for (int i = 0; i < nAttachments; ++i)
3586 {
3587 Class.CastTo(item, inventory.GetAttachmentFromIndex(i));
3588 if (item)
3589 item_count += item.GetNumberOfItems();
3590 }
3591 return item_count;
3592 }
proto native int GetItemCount()
proto native EntityAI GetAttachmentFromIndex(int index)
proto native CargoBase GetCargo()
cargo
proto native int AttachmentCount()
Returns count of attachments attached to this item.
void ItemBase()
Определения ItemBase.c:148

Перекрестные ссылки GameInventory::AttachmentCount(), Class::CastTo(), GameInventory::GetAttachmentFromIndex(), GameInventory::GetCargo(), CargoBase::GetItemCount() и ItemBase().