Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BIKIGearHelper.c
Go to the documentation of this file.
1#ifdef WORKBENCH
2class SCR_BIKIGearHelper
3{
5 //
6 // Characters's gear
7 //
9
10 //------------------------------------------------------------------------------------------------
13 static array<ResourceName> GetWeapons(notnull BaseContainer characterContainer)
14 {
15 array<IEntityComponentSource> entityComponentSources = {};
16 if (SCR_BaseContainerTools.FindComponentSourcesOfClass(characterContainer, CharacterWeaponSlotComponent, false, entityComponentSources) < 1)
17 return {};
18
19 array<ResourceName> result = {};
20
21 ResourceName resourceName;
22 foreach (IEntityComponentSource entityComponentSource : entityComponentSources)
23 {
24 if (entityComponentSource.Get("WeaponTemplate", resourceName) && resourceName) // !IsEmpty()
25 result.Insert(resourceName);
26 }
27
28 return result;
29 }
30
31 //------------------------------------------------------------------------------------------------
34 static array<ResourceName> GetItems(notnull BaseContainer characterContainer)
35 {
36 IEntityComponentSource entityComponentSource = SCR_BaseContainerTools.FindComponentSource(characterContainer, SCR_InventoryStorageManagerComponent);
37 if (!entityComponentSource)
38 return {};
39
40 array<ResourceName> result = {};
41
42 BaseContainerList inventoryItemConfigs = entityComponentSource.GetObjectArray("InitialInventoryItems");
43 array<ResourceName> prefabsToSpawn;
44 for (int i, count = inventoryItemConfigs.Count(); i < count; ++i)
45 {
46 if (inventoryItemConfigs.Get(i).Get("PrefabsToSpawn", prefabsToSpawn))
47 {
48 foreach (ResourceName prefabToSpawn : prefabsToSpawn)
49 {
50 result.Insert(prefabToSpawn);
51 }
52 }
53 }
54
55 return result;
56 }
57
58 //------------------------------------------------------------------------------------------------
61 static array<ResourceName> GetGear(notnull BaseContainer characterContainer)
62 {
63 IEntityComponentSource entityComponentSource = SCR_BaseContainerTools.FindComponentSource(characterContainer, BaseLoadoutManagerComponent);
64 if (!entityComponentSource)
65 return {};
66
67 array<ResourceName> result = {};
68
69 ResourceName resourceName;
70 BaseContainerList gearSlots = entityComponentSource.GetObjectArray("Slots");
71 for (int i, count = gearSlots.Count(); i < count; ++i)
72 {
73 if (gearSlots.Get(i).Get("Prefab", resourceName) && resourceName) // !IsEmpty()
74 result.Insert(resourceName);
75 }
76
77 return result;
78 }
79
81 //
82 // Gear itself
83 //
85}
86#endif // WORKBENCH
ResourceName resourceName
Definition SCR_AIGroup.c:66
proto external int GetWeapons(out notnull array< BaseWeaponComponent > outWeapons)