- Timestamp:
- Sep 10, 2014, 8:09:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/JSON/JSONBoolean.cs
r154 r187 12 12 } 13 13 14 public override string ToString () 14 public bool GetBool () 15 { 16 return value; 17 } 18 19 public override string ToString (bool prettyPrint = false, int currentLevel = 0) 15 20 { 16 21 return value.ToString (System.Globalization.CultureInfo.InvariantCulture).ToLower (); 22 } 23 24 public static JSONBoolean Parse (string json, ref int offset) 25 { 26 //Log.Out ("ParseBool enter (" + offset + ")"); 27 28 if (json.Substring (offset, 4).Equals ("true")) { 29 //Log.Out ("JSON:Parsed Bool: true"); 30 offset += 4; 31 return new JSONBoolean (true); 32 } else if (json.Substring (offset, 5).Equals ("false")) { 33 //Log.Out ("JSON:Parsed Bool: false"); 34 offset += 5; 35 return new JSONBoolean (false); 36 } else { 37 throw new MalformedJSONException ("No valid boolean found"); 38 } 17 39 } 18 40
Note:
See TracChangeset
for help on using the changeset viewer.