Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SpawnPointRequestResultInfoConfig.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot: true)]
3 {
4  [Attribute(desc: "When a spawn point is disabled the system will go over each disable reason in order and will return the first valid disable reason")]
5  protected ref array<ref SCR_BaseSpawnPointRequestResultInfo> m_aSpawnPointRequestResultInfos;
6 
7  //~ Holds a sorted list that orders the spawn point not allowed reason depending on the given order
8  protected ref SCR_SortedArray<SCR_BaseSpawnPointRequestResultInfo> m_aSortedSpawnPointRequestResultInfos = new SCR_SortedArray<SCR_BaseSpawnPointRequestResultInfo>();
9 
10  //------------------------------------------------------------------------------------------------
11  // constructor
13  {
14  if (SCR_Global.IsEditMode())
15  return;
16 
17  int count = m_aSpawnPointRequestResultInfos.Count();
18 
19  SCR_BaseSpawnPointRequestResultInfo foundRequestResult;
20 
21  //~ Init ordered list
22  for (int i = count - 1; i >= 0; i--)
23  {
24  foundRequestResult = m_aSpawnPointRequestResultInfos[i];
25 
26  if (!foundRequestResult || !foundRequestResult.m_bEnabled)
27  {
28  m_aSpawnPointRequestResultInfos.RemoveOrdered(i);
29  continue;
30  }
31 
32  if (!foundRequestResult.GetUIInfo())
33  {
34  m_aSpawnPointRequestResultInfos.RemoveOrdered(i);
35  Print("'SCR_SpawnPointDisabledReasonConfig' init, entry: '" + i + "' has no UIInfo assigned and thus is removed.", LogLevel.ERROR);
36  continue;
37  }
38 
39  m_aSortedSpawnPointRequestResultInfos.Insert(foundRequestResult.m_iOrder, foundRequestResult);
40  }
41  }
42 
43  //------------------------------------------------------------------------------------------------
48  SCR_BaseSpawnPointRequestResultInfo GetFirstValidRequestResultInfo(SCR_SpawnRequestComponent requestComponent, SCR_ESpawnResult response, SCR_SpawnData data)
49  {
50  SCR_BaseSpawnPointRequestResultInfo requestResultInfo;
51 
52  int count = m_aSortedSpawnPointRequestResultInfos.Count();
53  for(int i = 0; i < count; ++i)
54  {
55  requestResultInfo = SCR_BaseSpawnPointRequestResultInfo.Cast(m_aSortedSpawnPointRequestResultInfos.Get(i));
56  if (!requestResultInfo || !requestResultInfo.IsValidRequestResultInfo(requestComponent, response, data))
57  continue;
58 
59  //~ Is the first valid not allowed reason
60  return requestResultInfo;
61  }
62 
63  return null;
64  }
65 }
SCR_ESpawnResult
SCR_ESpawnResult
Definition: SCR_ESpawnResult.c:8
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_SpawnData
Definition: SCR_SpawnData.c:9
SCR_SpawnPointRequestResultInfoConfig
Definition: SCR_SpawnPointRequestResultInfoConfig.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseSpawnPointRequestResultInfo
Definition: SCR_BaseSpawnPointRequestResultInfo.c:2
SCR_Global
Definition: Functions.c:6
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468