DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetJson()

string JsonObject::GetJson ( )
inlineprivate

См. определение в файле JsonObject.c строка 85

86 {
87 string name;
88 int i;
89
90 string jsn = "";
91 jsn += "{";
92
93 // Parse Strings
94 for ( i = 0; i < m_Strings.Count(); ++i )
95 {
96 if ( jsn.Length() > 1 )
97 {
98 jsn += ",";
99 }
100
101 name = m_Strings.GetKey(i);
102 string value_str = m_Strings.GetElement(i);
103
104 jsn += "\""+name+"\":\""+value_str+"\"";
105 }
106
107 // Parse Ints
108 for ( i = 0; i < m_Ints.Count(); ++i )
109 {
110 if ( jsn.Length() > 1 )
111 {
112 jsn += ",";
113 }
114
115 name = m_Ints.GetKey(i);
116 int value_int = m_Ints.GetElement(i);
117
118 jsn += "\""+name+"\":"+value_int;
119 }
120
121 // Parse Floats
122 for ( i = 0; i < m_Floats.Count(); ++i )
123 {
124 if ( jsn.Length() > 1 )
125 {
126 jsn += ",";
127 }
128
129 name = m_Floats.GetKey(i);
130 float value_flt = m_Floats.GetElement(i);
131
132 jsn += "\""+name+"\":"+value_flt;
133 }
134
135 // Parse Bools
136 for ( i = 0; i < m_Bools.Count(); ++i )
137 {
138 if ( jsn.Length() > 1 )
139 {
140 jsn += ",";
141 }
142
143 name = m_Bools.GetKey(i);
144
145 if ( m_Bools.GetElement(i) )
146 {
147 jsn += "\""+name+"\":true";
148 }
149 else
150 {
151 jsn += "\""+name+"\":false";
152 }
153 }
154
155 // Parse Vectors2
156 for ( i = 0; i < m_Vectors2.Count(); ++i )
157 {
158 if ( jsn.Length() > 1 )
159 {
160 jsn += ",";
161 }
162
163 name = m_Vectors2.GetKey(i);
164 Vector2 value_vct = m_Vectors2.GetElement(i);
165
166 jsn += "\""+name+"\":{\"x\":"+value_vct.x+",\"y\":"+value_vct.y+"}";
167 }
168
169 jsn += "}";
170
171 return jsn;
172 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ref map< string, string > m_Strings
Определения JsonObject.c:3
ref map< string, float > m_Floats
Определения JsonObject.c:5
ref map< string, int > m_Ints
Определения JsonObject.c:4
ref map< string, ref Vector2 > m_Vectors2
Определения JsonObject.c:7
ref map< string, bool > m_Bools
Определения JsonObject.c:6
float x
Определения Vector2.c:9
float y
Определения Vector2.c:10
proto native int Length()
Returns length of string.

Перекрестные ссылки string::Length(), m_Bools, m_Floats, m_Ints, m_Strings, m_Vectors2, name, Vector2::x и Vector2::y.