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

◆ ProcessCargo()

map< ECachedEquipmentItemCategory, ref array< ref CachedEquipmentItemAttribute > > ProcessCargo ( CachedEquipmentStorageInventoryEntry params)
private

Processes cargo of item given through params.

Аргументы
paramsinventory item setting defined by CachedEquipmentStorageInventoryEntry
Возвращает
map containing ECachedEquipmentItemCategory and array of CachedEquipmentItemAttribute for further processing (cache insert/removal)

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

220 {
221 CachedItemAttributesPerCategory cargoAttributesPerCategory = new CachedItemAttributesPerCategory();
222 if (params.m_GameInventory.GetCargo())
223 {
224 int cargoCount = params.m_GameInventory.GetCargo().GetItemCount();
225 for (int cargoIndex = 0; cargoIndex < cargoCount; ++cargoIndex)
226 {
227 EntityAI cargo = params.m_GameInventory.GetCargo().GetItem(cargoIndex);
228 ECachedEquipmentItemCategory category = cargo.GetCachedEquipmentCategory();
229 if (category == ECachedEquipmentItemCategory.NONE)
230 continue;
231
232 if (params.m_OperationMode == ECachedEquipmentOperationMode.INSERT && IsStored(cargo, category))
233 continue;
234
235 CachedEquipmentItemAttribute newItemAttributes = new CachedEquipmentItemAttribute();
236
237 newItemAttributes.m_Entity = cargo;
238 newItemAttributes.m_Parent = cargo.GetHierarchyParent();
239 newItemAttributes.m_InventoryDepth = cargo.GetHierarchyLevel();
240 newItemAttributes.m_InventoryPlacement = ECachedEquipmentPlacement.CARGO;
241
243 if (!cargoAttributesPerCategory.Find(category, arr))
244 {
246 cargoAttributesPerCategory.Set(category, arr);
247 }
248
249 #ifdef ENABLE_LOGGING
250 LogMessage(string.Format("parent:%1 entity:%2", newItemAttributes.m_Parent, cargo), string.Format("%1:ProcessCargo", params.m_CallerMethod));
251 #endif
252
253 arr.Insert(newItemAttributes);
254 }
255 }
256
257 return cargoAttributesPerCategory;
258 }
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
ECachedEquipmentOperationMode
Определения ECachedEquipmentOperationMode.c:2
ECachedEquipmentPlacement
Определения ECachedEquipmentPlacement.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

Используется в ProcessItemInventory().