Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
См. определение в файле ItemBase.c строка 3550
3551 {
3552 int item_count = 0;
3554
3557 if (cargo != NULL)
3558 {
3560 }
3561
3563 for (int i = 0; i < nAttachments; ++i)
3564 {
3566 if (item)
3567 item_count += item.GetNumberOfItems();
3568 }
3569 return item_count;
3570 }
proto native int GetItemCount()
represents base for cargo storage for entities
Super root of all classes in Enforce script.
proto native EntityAI GetAttachmentFromIndex(int index)
proto native CargoBase GetCargo()
cargo
proto native int AttachmentCount()
Returns count of attachments attached to this item.
script counterpart to engine's class Inventory
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Перекрестные ссылки GameInventory::AttachmentCount(), Class::CastTo(), GameInventory::GetAttachmentFromIndex(), GameInventory::GetCargo() и CargoBase::GetItemCount().
Используется в Barrel_ColorBase::CanDetachAttachment(), FireplaceBase::CanDetachAttachment(), ClothingBase::CanPutAsAttachment(), Barrel_ColorBase::CanPutInCargo(), Clothing::CanPutInCargo(), Clothing_Base::CanPutInCargoClothingConditions() и Barrel_ColorBase::CanPutIntoHands().