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

◆ ProcessAttachments()

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

Processes attachments 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 строка 174

175 {
176 CachedItemAttributesPerCategory attachmentAttributesPerCategory = new CachedItemAttributesPerCategory();
177
178 int attachments = params.m_GameInventory.AttachmentCount();
179 for (int attachmentIndex = 0; attachmentIndex < attachments; ++attachmentIndex)
180 {
181 EntityAI attachment = params.m_GameInventory.GetAttachmentFromIndex(attachmentIndex);
182 ECachedEquipmentItemCategory category = attachment.GetCachedEquipmentCategory();
183 if (category == ECachedEquipmentItemCategory.NONE)
184 continue;
185
186 if (params.m_OperationMode == ECachedEquipmentOperationMode.INSERT && IsStored(attachment, category))
187 continue;
188
189 CachedEquipmentItemAttribute newItemAttributes = new CachedEquipmentItemAttribute();
190 newItemAttributes.m_Entity = attachment;
191 newItemAttributes.m_Parent = attachment.GetHierarchyParent();
192 newItemAttributes.m_InventoryDepth = attachment.GetHierarchyLevel();
193 newItemAttributes.m_SlotIndex = params.m_SlotId;
194 newItemAttributes.m_InventoryPlacement = ECachedEquipmentPlacement.ATTACHMENT;
195
197 if (!attachmentAttributesPerCategory.Find(category, arr))
198 {
200 attachmentAttributesPerCategory.Set(category, arr);
201 }
202
203 #ifdef ENABLE_LOGGING
204 LogMessage(string.Format("parent:%1 entity:%2", newItemAttributes.m_Parent, attachment), string.Format("%1:ProcessAttachments", params.m_CallerMethod));
205 #endif
206
207 arr.Insert(newItemAttributes);
208 }
209
210 return attachmentAttributesPerCategory;
211 }
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
ECachedEquipmentOperationMode
Определения ECachedEquipmentOperationMode.c:2
ECachedEquipmentPlacement
Определения ECachedEquipmentPlacement.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

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