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)
71 m_Floats.Insert(
name, 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 int nStrings = m_Strings.Count();
95 for ( i = 0; i < nStrings; ++i )
97 if ( jsn.Length() > 1 )
102 name = m_Strings.GetKey(i);
103 string value_str = m_Strings.GetElement(i);
105 jsn +=
"\""+
name+
"\":\""+value_str+
"\"";
109 int nInts = m_Ints.Count();
110 for ( i = 0; i < nInts; ++i )
112 if ( jsn.Length() > 1 )
117 name = m_Ints.GetKey(i);
118 int value_int = m_Ints.GetElement(i);
120 jsn +=
"\""+
name+
"\":"+value_int;
124 int nFloats = m_Floats.Count();
125 for ( i = 0; i < nFloats; ++i )
127 if ( jsn.Length() > 1 )
132 name = m_Floats.GetKey(i);
133 float value_flt = m_Floats.GetElement(i);
135 jsn +=
"\""+
name+
"\":"+value_flt;
139 int nBools = m_Bools.Count();
140 for ( i = 0; i < nBools; ++i )
142 if ( jsn.Length() > 1 )
147 name = m_Bools.GetKey(i);
149 if ( m_Bools.GetElement(i) )
151 jsn +=
"\""+
name+
"\":true";
155 jsn +=
"\""+
name+
"\":false";
160 int nVectors2 = m_Vectors2.Count();
161 for ( i = 0; i < nVectors2; ++i )
163 if ( jsn.Length() > 1 )
168 name = m_Vectors2.GetKey(i);
169 Vector2 value_vct = m_Vectors2.GetElement(i);
171 jsn +=
"\""+
name+
"\":{\"x\":"+value_vct.x+
",\"y\":"+value_vct.y+
"}";