Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
CampaignBasesSystem.c
Go to the documentation of this file.
2 {
3  protected ref array<SCR_CampaignMilitaryBaseComponent> m_Components = {};
4 
5  //------------------------------------------------------------------------------------------------
6  override protected void OnUpdate(ESystemPoint point)
7  {
8  float timeSlice = GetWorld().GetFixedTimeSlice();
9 
10  foreach (SCR_CampaignMilitaryBaseComponent comp: m_Components)
11  {
12  comp.Update(timeSlice);
13  }
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override protected void OnDiag(float timeSlice)
18  {
19  DbgUI.Begin("CampaignBasesSystem");
20 
21  DbgUI.Text("Items: " + m_Components.Count());
22 
23  if (DbgUI.Button("Dump active components"))
24  {
25  foreach (SCR_CampaignMilitaryBaseComponent comp: m_Components)
26  {
27  Print(comp.GetOwner(), LogLevel.ERROR);
28  }
29  }
30 
31  DbgUI.End();
32  }
33 
34  //------------------------------------------------------------------------------------------------
36  void Register(SCR_CampaignMilitaryBaseComponent component)
37  {
38  //About to be deleted
39  if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
40  return;
41 
42  if (m_Components.Find(component) != -1)
43  return;
44 
45  m_Components.Insert(component);
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  void Unregister(SCR_CampaignMilitaryBaseComponent component)
50  {
51  int idx = m_Components.Find(component);
52  if (idx == -1)
53  return;
54 
55  m_Components.Remove(idx);
56  }
57 }
GameSystem
Definition: GameSystem.c:12
CampaignBasesSystem
Definition: CampaignBasesSystem.c:1
SCR_CampaignMilitaryBaseComponent
Definition: SCR_CampaignMilitaryBaseComponent.c:38