32 void AddString(
string name,
string value)
35 value.Split(
"\"", strgs);
37 if ( strgs.Count() > 1 )
40 int str_count = strgs.Count();
42 for (
int i = 0; i < str_count; ++i )
46 int length = s.Length();
48 if ( s[length - 1] !=
"\\" )
52 if (i < str_count - 1 )
61 m_Strings.Insert(
name, value);
64 void AddInt(
string name,
int value)
66 m_Ints.Insert(
name, value);
69 void AddFloat(
string name,
float value)
74 void AddBool(
string name,
bool value)
76 m_Bools.Insert(
name, value);
79 void AddVector2(
string name,
float x,
float y)
82 m_Vectors2.Insert(
name, v);
94 for ( i = 0; i < m_Strings.Count(); ++i )
96 if ( jsn.Length() > 1 )
101 name = m_Strings.GetKey(i);
102 string value_str = m_Strings.GetElement(i);
104 jsn +=
"\""+
name+
"\":\""+value_str+
"\"";
108 for ( i = 0; i < m_Ints.Count(); ++i )
110 if ( jsn.Length() > 1 )
115 name = m_Ints.GetKey(i);
116 int value_int = m_Ints.GetElement(i);
118 jsn +=
"\""+
name+
"\":"+value_int;
122 for ( i = 0; i <
m_Floats.Count(); ++i )
124 if ( jsn.Length() > 1 )
130 float value_flt =
m_Floats.GetElement(i);
132 jsn +=
"\""+
name+
"\":"+value_flt;
136 for ( i = 0; i < m_Bools.Count(); ++i )
138 if ( jsn.Length() > 1 )
143 name = m_Bools.GetKey(i);
145 if ( m_Bools.GetElement(i) )
147 jsn +=
"\""+
name+
"\":true";
151 jsn +=
"\""+
name+
"\":false";
156 for ( i = 0; i < m_Vectors2.Count(); ++i )
158 if ( jsn.Length() > 1 )
163 name = m_Vectors2.GetKey(i);
164 Vector2 value_vct = m_Vectors2.GetElement(i);
166 jsn +=
"\""+
name+
"\":{\"x\":"+value_vct.x+
",\"y\":"+value_vct.y+
"}";