Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_WeaponAttachmentsStorageComponentSerializer.c
Go to the documentation of this file.
1class SCR_BaseInventoryStorageComponentSerializerSlot
2{
4 int m_iNumRequirements = 0;
5
7
8 //------------------------------------------------------------------------------------------------
9 void SCR_BaseInventoryStorageComponentSerializerSlot(BaseInventoryStorageComponentSerializerSlot slot)
10 {
11 m_pSlot = slot;
12
13 auto inventoryItemComponent = InventoryItemComponent.Cast(slot.GetEntity().FindComponent(InventoryItemComponent));
14 if (!inventoryItemComponent)
15 return;
16
17 auto obstructionAttributes = SCR_WeaponAttachmentObstructionAttributes.Cast(inventoryItemComponent.FindAttribute(SCR_WeaponAttachmentObstructionAttributes));
18 if (!obstructionAttributes)
19 return;
20
21 m_iNumRequirements = obstructionAttributes.GetRequiredAttachmentTypes().Count();
22 }
23}
24
25class SCR_WeaponAttachmentsStorageComponentSerializer : WeaponAttachmentsStorageComponentSerializer
26{
27 //------------------------------------------------------------------------------------------------
28 override static typename GetTargetType()
29 {
30 return SCR_WeaponAttachmentsStorageComponent;
31 }
33 //------------------------------------------------------------------------------------------------
34 override protected void HandleInsertionOrder(inout array<BaseInventoryStorageComponentSerializerSlot> slots)
35 {
36 array<ref SCR_BaseInventoryStorageComponentSerializerSlot> sortedSlots();
37 foreach (auto slot : slots)
38 {
40 sortedSlots.Insert(sortSlot);
41 }
42 sortedSlots.Sort();
43
44 slots.Clear();
45 foreach (auto sortedSlot : sortedSlots)
46 {
47 slots.Insert(sortedSlot.m_pSlot);
48 }
49 }
50}
class SCR_PersistentThreatSector GetTargetType()
void HandleInsertionOrder(inout array< BaseInventoryStorageComponentSerializerSlot > slots)
proto external Managed FindComponent(typename typeName)