Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorAttributeStruct.c
Go to the documentation of this file.
1 
7 {
8  //--- Serialized (names shortened to save memory)
9  protected int id; //--- ID
10  protected int ty; //--- Type
11  protected float v0; //--- Var 0
12  protected float v1; //--- Var 1
13  protected float v2; //--- Var 2
14 
21  static void SerializeAttributes(out notnull array<ref SCR_EditorAttributeStruct> outEntries, SCR_EditorAttributeList attributeList = null, Managed item = null)
22  {
23  outEntries.Clear();
24 
25  SCR_BaseEditorAttribute attribute;
27  for (int i = 0, count = attributeList.GetAttributesCount(); i < count; i++)
28  {
29  attribute = attributeList.GetAttribute(i);
30  if (!attribute.IsServer() || !attribute.IsSerializable())
31  continue;
32 
33  var = attribute.ReadVariable(item, null);
34  if (!var)
35  continue;
36 
38  outEntries.Insert(entry);
39  entry.id = i;
40 
41  entry.v0 = var.GetVector()[0];
42  entry.v1 = var.GetVector()[1];
43  entry.v2 = var.GetVector()[2];
44  }
45  }
52  static void DeserializeAttributes(notnull array<ref SCR_EditorAttributeStruct> entries, SCR_EditorAttributeList attributeList = null, Managed item = null)
53  {
54  SCR_BaseEditorAttribute attribute;
56 
57  foreach (SCR_EditorAttributeStruct entry: entries)
58  {
59  attribute = attributeList.GetAttribute(entry.id);
60  if (!attribute.IsSerializable())
61  continue;
62 
63  var = SCR_BaseEditorAttributeVar.CreateVector(Vector(entry.v0, entry.v1, entry.v2));
64  attribute.WriteVariable(item, var, null, -1);
65  }
66  }
73  static void LogAttributes(out notnull array<ref SCR_EditorAttributeStruct> entries, SCR_EditorAttributeList attributeList = null, string prefix = "")
74  {
75  Print(prefix + " SCR_EditorAttributeStruct: " + entries.Count());
76  foreach (SCR_EditorAttributeStruct entry: entries)
77  {
78  PrintFormat(prefix + " %1: %2, %3, %4", attributeList.GetAttribute(entry.id).ClassName(), entry.v0, entry.v1, entry.v2);
79  }
80  }
82  {
83  RegV("id");
84  RegV("v0");
85  RegV("v1");
86  RegV("v2");
87  }
88 };
JsonApiStruct
Parameters for joining server.
Definition: FeedbackDialogUI.c:2
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
SCR_EditorAttributeList
Definition: SCR_EditorAttributeConfig.c:2
SCR_EditorAttributeStruct
Definition: SCR_EditorAttributeStruct.c:6