Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseEditorAttributeVar.c
Go to the documentation of this file.
2{
3 static const int SNAPSHOT_SIZE_VALUE = 12; //--- Vector
4
5 protected vector m_vValue; //--- All variables are saved as a vector in the end (ToDo: Find lighter solution?)
6
7 //--- Integer
12 void SetInt(int value)
13 {
14 m_vValue[0] = value;
15 }
16
20 int GetInt()
21 {
22 return m_vValue[0];
23 }
24
25 //--- Float
30 void SetFloat(float value)
31 {
32 m_vValue[0] = value;
33 }
34
38 float GetFloat()
39 {
40 return m_vValue[0];
41 }
42
43 //--- Bool
48 void SetBool(bool value)
49 {
50 m_vValue[0] = value;
51 }
52
56 bool GetBool()
57 {
58 return m_vValue[0] != 0;
59 }
60
61 //--- Vector
66 void SetVector(vector value)
67 {
68 m_vValue = value;
69 }
70
75 {
76 return m_vValue;
77 }
78
79 //--- Network functions
80 static void Encode(SSnapSerializerBase snapshot, ScriptCtx hint, ScriptBitSerializer packet)
81 {
82 snapshot.Serialize(packet, SNAPSHOT_SIZE_VALUE);
83 }
84 static bool Decode(ScriptBitSerializer packet, ScriptCtx hint, SSnapSerializerBase snapshot)
85 {
86 return snapshot.Serialize(packet, SNAPSHOT_SIZE_VALUE);
87 }
89 {
90 return lhs.CompareSnapshots(rhs, SNAPSHOT_SIZE_VALUE);
91 }
93 {
94 return snapshot.Compare(prop.m_vValue, SNAPSHOT_SIZE_VALUE);
95 }
97 {
98 snapshot.SerializeBytes(prop.m_vValue, SNAPSHOT_SIZE_VALUE);
99 return true;
100 }
102 {
103 return Extract(prop, hint, snapshot);
104 }
105
106 //--- Default functions
108 {
110 var.SetInt(value);
111 return var;
112 }
114 {
116 var.SetFloat(value);
117 return var;
118 }
120 {
122 var.SetBool(value);
123 return var;
124 }
126 {
128 var.SetVector(value);
129 return var;
130 }
131};
static SCR_BaseEditorAttributeVar CreateBool(bool value)
static bool PropCompare(SCR_BaseEditorAttributeVar prop, SSnapSerializerBase snapshot, ScriptCtx hint)
static bool Decode(ScriptBitSerializer packet, ScriptCtx hint, SSnapSerializerBase snapshot)
static SCR_BaseEditorAttributeVar CreateInt(int value)
static SCR_BaseEditorAttributeVar CreateVector(vector value)
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx hint, SCR_BaseEditorAttributeVar prop)
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx hint)
static bool Extract(SCR_BaseEditorAttributeVar prop, ScriptCtx hint, SSnapSerializerBase snapshot)
static void Encode(SSnapSerializerBase snapshot, ScriptCtx hint, ScriptBitSerializer packet)
static SCR_BaseEditorAttributeVar CreateFloat(float value)