Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MilitarySymbol.c
Go to the documentation of this file.
3 {
4  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolIdentity))]
5  protected EMilitarySymbolIdentity m_Identity;
6 
7  [Attribute("1", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolDimension))]
8  protected EMilitarySymbolDimension m_Dimension;
9 
10  [Attribute("0", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(EMilitarySymbolIcon))]
11  protected EMilitarySymbolIcon m_Icons;
12 
13  [Attribute("0", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EMilitarySymbolAmplifier))]
14  protected EMilitarySymbolAmplifier m_Amplifier;
15 
20  EMilitarySymbolIdentity GetIdentity()
21  {
22  return m_Identity;
23  }
28  void SetIdentity(EMilitarySymbolIdentity identity)
29  {
30  m_Identity = identity;
31  }
36  EMilitarySymbolDimension GetDimension()
37  {
38  return m_Dimension;
39  }
44  void SetDimension(EMilitarySymbolDimension dimension)
45  {
46  m_Dimension = dimension;
47  }
52  EMilitarySymbolIcon GetIcons()
53  {
54  return m_Icons;
55  }
60  void SetIcons(EMilitarySymbolIcon icons)
61  {
62  m_Icons = icons;
63  }
68  bool HasIcon(EMilitarySymbolIcon icon)
69  {
70  return SCR_Enum.HasFlag(m_Icons, icon);
71  }
76  EMilitarySymbolAmplifier GetAmplifier()
77  {
78  return m_Amplifier;
79  }
84  void SetAmplifier(EMilitarySymbolAmplifier amplifier)
85  {
86  m_Amplifier = amplifier;
87  }
88 
97  {
98  m_Identity = identity;
99  m_Dimension = dimension;
100  m_Icons = icons;
101  m_Amplifier = amplifier;
102  }
103 
108  void CopyFrom(SCR_MilitarySymbol from)
109  {
110  m_Identity = from.m_Identity;
111  m_Dimension = from.m_Dimension;
112  m_Icons = from.m_Icons;
113  m_Amplifier = from.m_Amplifier;
114  }
120  bool IsEqual(SCR_MilitarySymbol symbol)
121  {
122  return m_Identity == symbol.m_Identity
123  && m_Dimension == symbol.m_Dimension
124  && m_Icons == symbol.m_Icons
125  && m_Amplifier == symbol.m_Amplifier;
126  }
127 
132  void Log(LogLevel logLevel = LogLevel.DEBUG)
133  {
134  string identityName = typename.EnumToString(EMilitarySymbolIdentity, m_Identity);
135  string dimensionName = typename.EnumToString(EMilitarySymbolDimension, m_Dimension);
136  string amplifierName = typename.EnumToString(EMilitarySymbolAmplifier, m_Amplifier);
137  string iconNames = SCR_Enum.FlagsToString(EMilitarySymbolIcon, m_Icons);
138 
139  Print(string.Format("%1 | %2 | %3 | %4", identityName, dimensionName, iconNames, amplifierName), logLevel);
140  }
141 
142  //--- Codec
143  static void Encode(SSnapSerializerBase snapshot, ScriptCtx hint, ScriptBitSerializer packet)
144  {
145  snapshot.Serialize(packet, 16);
146  }
147  static bool Decode(ScriptBitSerializer packet, ScriptCtx hint, SSnapSerializerBase snapshot)
148  {
149  return snapshot.Serialize(packet, 16);
150  }
151  static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx hint)
152  {
153  return lhs.CompareSnapshots(rhs, 16);
154  }
155  static bool PropCompare(SCR_MilitarySymbol prop, SSnapSerializerBase snapshot, ScriptCtx hint)
156  {
157  return snapshot.CompareInt(prop.m_Identity)
158  && snapshot.CompareInt(prop.m_Dimension)
159  && snapshot.CompareInt(prop.m_Icons)
160  && snapshot.CompareInt(prop.m_Amplifier);
161  }
162  static bool Extract(SCR_MilitarySymbol prop, ScriptCtx hint, SSnapSerializerBase snapshot)
163  {
164  snapshot.SerializeInt(prop.m_Identity);
165  snapshot.SerializeInt(prop.m_Dimension);
166  snapshot.SerializeInt(prop.m_Icons);
167  snapshot.SerializeInt(prop.m_Amplifier);
168  return true;
169  }
170  static bool Inject(SSnapSerializerBase snapshot, ScriptCtx hint, SCR_MilitarySymbol prop)
171  {
172  snapshot.SerializeInt(prop.m_Identity);
173  snapshot.SerializeInt(prop.m_Dimension);
174  snapshot.SerializeInt(prop.m_Icons);
175  snapshot.SerializeInt(prop.m_Amplifier);
176  return true;
177  }
178 
179  void OnRplSave(ScriptBitWriter writer)
180  {
181  writer.WriteInt(m_Identity);
182  writer.WriteInt(m_Dimension);
183  writer.WriteInt(m_Icons);
184  writer.WriteInt(m_Amplifier);
185  }
186  void OnRplLoad(ScriptBitReader reader)
187  {
188  reader.ReadInt(m_Identity);
189  reader.ReadInt(m_Dimension);
190  reader.ReadInt(m_Icons);
191  reader.ReadInt(m_Amplifier);
192  }
193 };
194 class SCR_BaseContainerMilitarySymbol: BaseContainerCustomTitle
195 {
196  override bool _WB_GetCustomTitle(BaseContainer source, out string title)
197  {
198  EMilitarySymbolIdentity identity;
199  source.Get("m_Identity", identity);
200 
201  EMilitarySymbolDimension dimension;
202  source.Get("m_Dimension", dimension);
203 
204  EMilitarySymbolIcon icons;
205  source.Get("m_Icons", icons);
206 
207  EMilitarySymbolAmplifier amplifier;
208  source.Get("m_Amplifier", amplifier);
209 
210  string identityName = typename.EnumToString(EMilitarySymbolIdentity, identity);
211  string dimensionName = typename.EnumToString(EMilitarySymbolDimension, dimension);
212  string amplifierName = typename.EnumToString(EMilitarySymbolAmplifier, amplifier);
213  string iconNames = SCR_Enum.FlagsToString(EMilitarySymbolIcon, icons);
214 
215  title = string.Format("%1 | %2 | %3 | %4", identityName, dimensionName, iconNames, amplifierName);
216 
217  return true;
218  }
219 };
SCR_MilitarySymbol
Definition: SCR_MilitarySymbol.c:2
SCR_Enum
Definition: SCR_Enum.c:1
EMilitarySymbolIdentity
EMilitarySymbolIdentity
Definition: EMilitarySymbol.c:1
SCR_BaseContainerMilitarySymbol
Definition: SCR_MilitarySymbol.c:194
Attribute
typedef Attribute
Post-process effect of scripted camera.
EMilitarySymbolAmplifier
EMilitarySymbolAmplifier
Definition: EMilitarySymbol.c:63
EMilitarySymbolDimension
EMilitarySymbolDimension
Definition: EMilitarySymbol.c:14
EMilitarySymbolIcon
EMilitarySymbolIcon
Definition: EMilitarySymbol.c:29
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