Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MissionStruct.c
Go to the documentation of this file.
1 
8 {
9  [Attribute()]
10  protected ref SCR_MetaStruct m_Meta;
11 
12  [Attribute()]
13  protected ref SCR_JsonApiStruct m_Struct0;
14 
15  [Attribute()]
16  protected ref SCR_JsonApiStruct m_Struct1;
17 
18  [Attribute()]
19  protected ref SCR_JsonApiStruct m_Struct2;
20 
21  [Attribute()]
22  protected ref SCR_JsonApiStruct m_Struct3;
23 
24  [Attribute()]
25  protected ref SCR_JsonApiStruct m_Struct4;
26 
27  [Attribute()]
28  protected ref SCR_JsonApiStruct m_Struct5;
29 
30  [Attribute()]
31  protected ref SCR_JsonApiStruct m_Struct6;
32 
33  [Attribute()]
34  protected ref SCR_JsonApiStruct m_Struct7;
35 
36  [Attribute()]
37  protected ref SCR_JsonApiStruct m_Struct8;
38 
39  [Attribute()]
40  protected ref SCR_JsonApiStruct m_Struct9;
41 
42  //--- Array of structs can't be attribute directly, because it would be deserialized using base class SCR_JsonApiStruct
43  protected ref array<SCR_JsonApiStruct> m_aStructs = {m_Struct0, m_Struct1, m_Struct2, m_Struct3, m_Struct4, m_Struct5, m_Struct6, m_Struct7, m_Struct8, m_Struct9};
44 
45  protected ref set<typename> m_aStructTypes = new set<typename>();
46 
50  SCR_MetaStruct GetMeta()
51  {
52  return m_Meta;
53  }
54 
60  bool ContainsStruct(typename structType)
61  {
62  return m_aStructTypes.Contains(structType);
63  }
64 
65  override bool Serialize()
66  {
67  if (!m_Meta.Serialize())
68  return false;
69 
70  foreach (SCR_JsonApiStruct struct: m_aStructs)
71  {
72  if (struct && !struct.Serialize())
73  return false;
74  }
75  return true;
76  }
77  override bool Deserialize()
78  {
79  if (!m_Meta.Deserialize())
80  return false;
81 
82  foreach (SCR_JsonApiStruct struct: m_aStructs)
83  {
84  if (struct && !struct.Deserialize())
85  return false;
86  }
87  return true;
88  }
89  override void ClearCache()
90  {
91  m_Meta.ClearCache();
92 
93  foreach (SCR_JsonApiStruct struct: m_aStructs)
94  {
95  if (struct)
96  struct.ClearCache();
97  }
98  }
99  override void Log()
100  {
101  m_Meta.Log();
102 
103  foreach (SCR_JsonApiStruct struct: m_aStructs)
104  {
105  if (struct)
106  struct.Log();
107  }
108  }
109  void SCR_MissionStruct()
110  {
111  RegV("m_Meta");
112 
113  if (!m_Meta)
114  m_Meta = new SCR_MetaStruct();
115 
116  foreach (int i, SCR_JsonApiStruct struct: m_aStructs)
117  {
118  if (!struct)
119  continue;
120 
121  m_aStructTypes.Insert(struct.Type());
122 
123  RegV("m_Struct" + i); //--- Register only structs that are actually defined
124  }
125  }
126 };
SCR_MetaStruct
Definition: SCR_MetaStruct.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_MissionStruct
Definition: SCR_MissionStruct.c:7
SCR_JsonApiStruct
Definition: SCR_JsonApiStruct.c:5
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