5 protected ref array<ref SCR_GroupIdentityRuleIdentity> m_aRulesIdentity;
8 protected ref array<ref SCR_GroupIdentityRuleDimension> m_aRulesDimension;
11 protected ref array<ref SCR_GroupIdentityRuleIcon> m_aRulesIcon;
14 protected ref array<ref SCR_GroupIdentityRuleAmplifier> m_aRulesAmplifier;
16 protected ref SCR_SortedArray<SCR_GroupIdentityRule> m_aRulesIndentitySorted =
new SCR_SortedArray<SCR_GroupIdentityRule>();
17 protected ref SCR_SortedArray<SCR_GroupIdentityRule> m_aRulesDimensionSorted =
new SCR_SortedArray<SCR_GroupIdentityRule>();
18 protected ref SCR_SortedArray<SCR_GroupIdentityRule> m_aRulesIconSorted =
new SCR_SortedArray<SCR_GroupIdentityRule>();
19 protected ref SCR_SortedArray<SCR_GroupIdentityRule> m_aRulesAmplifierSorted =
new SCR_SortedArray<SCR_GroupIdentityRule>();
30 ProcessRules(m_aRulesIndentitySorted, outSymbol,
data);
31 ProcessRules(m_aRulesDimensionSorted, outSymbol,
data);
32 ProcessRules(m_aRulesIconSorted, outSymbol,
data);
33 ProcessRules(m_aRulesAmplifierSorted, outSymbol,
data);
44 ProcessRules(m_aRulesIndentitySorted, outSymbol,
data);
45 ProcessRules(m_aRulesDimensionSorted, outSymbol,
data);
46 ProcessRules(m_aRulesIconSorted, outSymbol,
data);
47 ProcessRules(m_aRulesAmplifierSorted, outSymbol,
data);
51 for (
int i = rules.Count() - 1; i >= 0; i--)
53 if (rules[i].SetSymbol(outSymbol,
data))
59 for (
int i = m_aRulesIdentity.Count() - 1; i >= 0; i--)
61 m_aRulesIndentitySorted.Insert(m_aRulesIdentity[i].
GetPriority(), m_aRulesIdentity[i]);
63 for (
int i = m_aRulesDimension.Count() - 1; i >= 0; i--)
65 m_aRulesDimensionSorted.Insert(m_aRulesDimension[i].
GetPriority(), m_aRulesDimension[i]);
67 for (
int i = m_aRulesIcon.Count() - 1; i >= 0; i--)
69 m_aRulesIconSorted.Insert(m_aRulesIcon[i].
GetPriority(), m_aRulesIcon[i]);
71 for (
int i = m_aRulesAmplifier.Count() - 1; i >= 0; i--)
73 m_aRulesAmplifierSorted.Insert(m_aRulesAmplifier[i].
GetPriority(), m_aRulesAmplifier[i]);
81 EVehicleType m_VehicleTypes;
82 ref map<EWeaponType, float> m_WeaponTypes =
new map<EWeaponType, float>();
83 ref map<EEditableEntityLabel, float> m_aLabels =
new map<EEditableEntityLabel, float>();
89 data.m_Faction = faction;
97 data.m_iMemberCount = group.GetAgentsCount();
100 array<AIAgent> agents = {};
101 data.m_iMemberCount = group.GetAgents(agents);
102 if (
data.m_iMemberCount > 0)
105 BaseWeaponManagerComponent weaponManager;
106 array<WeaponSlotComponent> weapons = {};
107 array<BaseMuzzleComponent> muzzles = {};
108 array<EEditableEntityLabel> labels = {};
109 data.m_WeaponTypes.Clear();
110 for (
int i; i <
data.m_iMemberCount; i++)
115 member = agents[i].GetControlledEntity();
116 weaponManager = BaseWeaponManagerComponent.Cast(member.FindComponent(BaseWeaponManagerComponent));
119 weaponManager.GetWeaponsSlots(weapons);
127 float weaponTypeCount;
128 if (
data.m_WeaponTypes.Find(weaponType, weaponTypeCount))
129 data.m_WeaponTypes[weaponType] = weaponTypeCount + 1;
131 data.m_WeaponTypes.Insert(weaponType, 1);
134 for (
int m = 0, mCount = slot.GetMuzzlesList(muzzles); m < mCount; m++)
138 switch (muzzles[m].GetMuzzleType())
147 if (muzzleWeaponType != -1 && muzzleWeaponType != weaponType)
149 if (
data.m_WeaponTypes.Find(muzzleWeaponType, weaponTypeCount))
150 data.m_WeaponTypes[muzzleWeaponType] = weaponTypeCount + 1;
152 data.m_WeaponTypes.Insert(muzzleWeaponType, 1);
165 for (
int l = 0, lCount = info.GetEntityLabels(labels); l < lCount; l++)
170 if (
data.m_aLabels.Find(label, labelCount))
171 data.m_aLabels[label] = labelCount + 1;
173 data.m_aLabels.Insert(label, 1);
181 foreach (
int weaponType,
float count:
data.m_WeaponTypes)
183 data.m_WeaponTypes[weaponType] = count /
data.m_iMemberCount;
186 foreach (
int label,
float count:
data.m_aLabels)
188 data.m_aLabels[label] = count /
data.m_iMemberCount;
194 array<IEntity> vehicles = {};
196 for (
int i, count = group.GetUsableVehicles(vehicles); i < count; i++)
198 vehicle = Vehicle.Cast(vehicles[i]);
200 data.m_VehicleTypes |= vehicle.m_eVehicleType;
210 protected int m_iPriority;
237 if (IsCompatible(outSymbol,
data))
239 outSymbol.SetIdentity(m_Identity);
249 protected string m_sFactionKey;
267 if (IsCompatible(outSymbol,
data))
269 outSymbol.SetDimension(m_Dimension);
286 if (IsCompatible(outSymbol,
data))
288 outSymbol.SetIcons(m_Icon);
300 [
Attribute(
"0.5", uiwidget: UIWidgets.Slider,
params:
"0 1 0.01",
desc:
"Condition is met only if ratio of weapons defined by 'Weapon Type' in the group is higher than this limit.\nE.g., Four-man group with two MGs will have MG ratio of 0.5")]
301 protected float m_fMinRatio;
303 [
Attribute(
"0", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(
EWeaponType),
desc:
"Condition is failed if any of these weapon types have ratio bigger than the one of 'Weapon Type', even when it's above 'Min Limit'")]
304 protected ref array<EWeaponType> m_ComparedWeaponTypes;
310 if (
data.m_WeaponTypes.Find(m_WeaponType, ratio) && ratio >= m_fMinRatio)
314 for (
int i = m_ComparedWeaponTypes.Count() - 1; i >= 0; i--)
316 if (
data.m_WeaponTypes.Find(m_ComparedWeaponTypes[i], comparedRatio) && comparedRatio >= ratio)
330 [
Attribute(
"0.5", uiwidget: UIWidgets.Slider,
params:
"0 1 0.01",
desc:
"Condition is met only if ratio of labels defined by 'Label' in the group is higher than this limit.\nE.g., Four-man group with two medics will have medic ratio of 0.5")]
331 protected float m_fMinRatio;
333 [
Attribute(
"0", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(
EEditableEntityLabel),
desc:
"Condition is failed if any of these labels have ratio bigger than the one of 'Label', even when it's above 'Min Limit'")]
334 protected ref array<EEditableEntityLabel> m_ComparedLabels;
340 if (
data.m_aLabels.Find(m_Label, ratio) && ratio >= m_fMinRatio)
344 for (
int i = m_ComparedLabels.Count() - 1; i >= 0; i--)
346 if (
data.m_aLabels.Find(m_ComparedLabels[i], comparedRatio) && comparedRatio >= ratio)
357 [
Attribute(
"0", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(EVehicleType))]
358 protected EVehicleType m_VehicleType;
362 return SCR_Enum.HasPartialFlag(
data.m_VehicleTypes, m_VehicleType);
376 if (IsCompatible(outSymbol,
data))
378 outSymbol.SetAmplifier(m_Amplifier);
388 protected int m_iMinCount;
392 return data.m_iMemberCount >= m_iMinCount;