Changeset 389 for binary-improvements2/7dtd-server-fixes/src
- Timestamp:
- Aug 7, 2022, 1:11:51 AM (2 years ago)
- Location:
- binary-improvements2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2
- Property svn:ignore
-
old new 1 .idea 1 2 bin 2 .idea 3 server-fixes.sln.DotSettings.user
-
- Property svn:ignore
-
binary-improvements2/7dtd-server-fixes
- Property svn:ignore
-
old new 1 bin 1 2 obj
-
- Property svn:ignore
-
binary-improvements2/7dtd-server-fixes/src/JSON/JSONBoolean.cs
r351 r389 34 34 throw new MalformedJSONException ("No valid boolean found"); 35 35 } 36 37 public override string AsString => value ? "true" : "false"; 38 public override int AsInt => value ? 1 : 0; 39 public override double AsDouble => AsInt; 36 40 } 37 41 } -
binary-improvements2/7dtd-server-fixes/src/JSON/JSONNull.cs
r351 r389 1 using System; 1 2 using System.Text; 2 3 … … 18 19 return new JSONNull (); 19 20 } 21 22 public override string AsString => throw new NotSupportedException (); 23 public override int AsInt => throw new NotSupportedException (); 24 public override double AsDouble => throw new NotSupportedException (); 20 25 } 21 26 } -
binary-improvements2/7dtd-server-fixes/src/JSON/JSONNumber.cs
r351 r389 109 109 throw new MalformedJSONException ("End of JSON reached before parsing number finished"); 110 110 } 111 112 public override string AsString => value.ToCultureInvariantString (); 113 public override int AsInt => GetInt (); 114 public override double AsDouble => value; 111 115 } 112 116 } -
binary-improvements2/7dtd-server-fixes/src/JSON/JSONObject.cs
r383 r389 7 7 8 8 public JSONNode this [string _name] { 9 get { return nodes [_name]; }10 set { nodes [_name] = value; }9 get => nodes [_name]; 10 set => nodes [_name] = value; 11 11 } 12 12 13 public int Count { 14 get { return nodes.Count; } 15 } 13 public int Count => nodes.Count; 16 14 17 public List<string> Keys { 18 get { return new List<string> (nodes.Keys); } 19 } 15 public List<string> Keys => new List<string> (nodes.Keys); 20 16 21 17 public bool ContainsKey (string _name) { 22 18 return nodes.ContainsKey (_name); 19 } 20 21 public bool TryGetValue (string _name, out JSONNode _node) { 22 return nodes.TryGetValue (_name, out _node); 23 23 } 24 24 -
binary-improvements2/7dtd-server-fixes/src/JSON/JSONString.cs
r351 r389 114 114 throw new MalformedJSONException ("End of JSON reached before parsing string finished"); 115 115 } 116 117 public override string AsString => value; 118 public override int AsInt => int.Parse (value); 119 public override double AsDouble => double.Parse (value); 116 120 } 117 121 } -
binary-improvements2/7dtd-server-fixes/src/JSON/JSONValue.cs
r325 r389 1 1 namespace AllocsFixes.JSON { 2 2 public abstract class JSONValue : JSONNode { 3 public abstract string AsString { get; } 4 public abstract int AsInt { get; } 5 public abstract double AsDouble { get; } 3 6 } 4 7 }
Note:
See TracChangeset
for help on using the changeset viewer.