|
Dictionary< string, object > | Fields = new Dictionary<string, object> () |
|
Definition at line 40 of file JSONObject.cs.
Hydrogen.Serialization.JSONObject.JSONObject |
( |
| ) |
|
Hydrogen.Serialization.JSONObject.JSONObject |
( |
Dictionary< string, string > |
prepopulate | ) |
|
Create a JSONObject and prepopulate it with the values from a Dictionary
- Parameters
-
prepopulate | A Dictionary<string,string> of values |
Definition at line 52 of file JSONObject.cs.
54 foreach (
string s
in prepopulate.Keys) {
55 Fields.Add (s, prepopulate [s]);
Hydrogen.Serialization.JSONObject.JSONObject |
( |
string |
json | ) |
|
static implicit Hydrogen.Serialization.JSONObject.operator Color |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 180 of file JSONObject.cs.
183 Convert.ToSingle (value [
"r"]),
184 Convert.ToSingle (value [
"g"]),
185 Convert.ToSingle (value [
"b"]),
186 Convert.ToSingle (value [
"a"])
static implicit Hydrogen.Serialization.JSONObject.operator Color32 |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 202 of file JSONObject.cs.
205 Convert.ToByte (value [
"r"]),
206 Convert.ToByte (value [
"g"]),
207 Convert.ToByte (value [
"b"]),
208 Convert.ToByte (value [
"a"])
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Vector2 |
value | ) |
|
|
explicitstatic |
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Vector3 |
value | ) |
|
|
explicitstatic |
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Quaternion |
value | ) |
|
|
explicitstatic |
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Color |
value | ) |
|
|
explicitstatic |
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Color32 |
value | ) |
|
|
explicitstatic |
static Hydrogen.Serialization.JSONObject.operator JSONObject |
( |
Rect |
value | ) |
|
|
explicitstatic |
Definition at line 234 of file JSONObject.cs.
238 o [
"left"] = value.xMin;
239 o [
"top"] = value.yMax;
240 o [
"width"] = value.width;
241 o [
"height"] = value.height;
static implicit Hydrogen.Serialization.JSONObject.operator Quaternion |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 158 of file JSONObject.cs.
160 return new Quaternion (
161 Convert.ToSingle (value [
"x"]),
162 Convert.ToSingle (value [
"y"]),
163 Convert.ToSingle (value [
"z"]),
164 Convert.ToSingle (value [
"w"])
static implicit Hydrogen.Serialization.JSONObject.operator Rect |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 224 of file JSONObject.cs.
227 Convert.ToByte (value [
"left"]),
228 Convert.ToByte (value [
"top"]),
229 Convert.ToByte (value [
"width"]),
230 Convert.ToByte (value [
"height"])
static implicit Hydrogen.Serialization.JSONObject.operator Vector2 |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 121 of file JSONObject.cs.
124 Convert.ToSingle (value [
"x"]),
125 Convert.ToSingle (value [
"y"]));
static implicit Hydrogen.Serialization.JSONObject.operator Vector3 |
( |
JSONObject |
value | ) |
|
|
static |
Definition at line 139 of file JSONObject.cs.
142 Convert.ToSingle (value [
"x"]),
143 Convert.ToSingle (value [
"y"]),
144 Convert.ToSingle (value [
"z"]));
T [] Hydrogen.Serialization.JSONObject.ToArray< T > |
( |
string |
fieldName | ) |
|
Definition at line 246 of file JSONObject.cs.
248 if (
Fields.ContainsKey (fieldName)) {
249 if (
Fields [fieldName] is IEnumerable) {
250 List<T> l =
new List<T> ();
251 foreach (
object o
in (
Fields[fieldName] as IEnumerable)) {
252 if (l is List<string>)
253 (l as List<string>).Add (Convert.ToString (o));
254 else if (l is List<int>)
255 (l as List<int>).Add (Convert.ToInt32 (o));
256 else if (l is List<float>)
257 (l as List<float>).Add (Convert.ToSingle (o));
258 else if (l is List<bool>)
259 (l as List<bool>).Add (Convert.ToBoolean (o));
260 else if (l is List<Vector2>)
261 (l as List<Vector2>).Add ((Vector2)((
JSONObject)o));
262 else if (l is List<Vector3>)
263 (l as List<Vector3>).Add ((Vector3)((
JSONObject)o));
264 else if (l is List<Rect>)
265 (l as List<Rect>).Add ((Rect)((
JSONObject)o));
266 else if (l is List<Color>)
267 (l as List<Color>).Add ((Color)((
JSONObject)o));
268 else if (l is List<Color32>)
269 (l as List<Color32>).Add ((Color32)((
JSONObject)o));
270 else if (l is List<Quaternion>)
271 (l as List<Quaternion>).Add ((Quaternion)((
JSONObject)o));
272 else if (l is List<JSONObject>)
Dictionary< string, object > Fields
bool Hydrogen.Serialization.JSONObject.ToBoolean |
( |
string |
fieldName | ) |
|
Definition at line 97 of file JSONObject.cs.
99 return Fields.ContainsKey (fieldName) && Convert.ToBoolean (
Fields [fieldName]);
Dictionary< string, object > Fields
float Hydrogen.Serialization.JSONObject.ToFloat |
( |
string |
fieldName | ) |
|
Definition at line 92 of file JSONObject.cs.
94 return Fields.ContainsKey (fieldName) ? Convert.ToSingle (
Fields [fieldName]) : 0.0f;
Dictionary< string, object > Fields
int Hydrogen.Serialization.JSONObject.ToInt |
( |
string |
fieldName | ) |
|
Definition at line 87 of file JSONObject.cs.
89 return Fields.ContainsKey (fieldName) ? Convert.ToInt32 (
Fields [fieldName]) : 0;
Dictionary< string, object > Fields
JSONObject Hydrogen.Serialization.JSONObject.ToJSON |
( |
string |
fieldName | ) |
|
Definition at line 113 of file JSONObject.cs.
115 if (!
Fields.ContainsKey (fieldName))
Dictionary< string, object > Fields
string Hydrogen.Serialization.JSONObject.ToString |
( |
string |
fieldName | ) |
|
Definition at line 82 of file JSONObject.cs.
84 return Fields.ContainsKey (fieldName) ? Convert.ToString (
Fields [fieldName]) :
"";
Dictionary< string, object > Fields
Dictionary<string, object> Hydrogen.Serialization.JSONObject.Fields = new Dictionary<string, object> () |
string Hydrogen.Serialization.JSONObject.Serialized |
|
getset |
object Hydrogen.Serialization.JSONObject.this[string fieldName] |
|
getset |