File tree Expand file tree Collapse file tree 2 files changed +36
-33
lines changed
Framework/Intersect.Framework.Core/GameObjects/Conditions Expand file tree Collapse file tree 2 files changed +36
-33
lines changed Original file line number Diff line number Diff line change 11using Intersect . Framework . Core . Serialization ;
22using Newtonsoft . Json ;
3- using Newtonsoft . Json . Linq ;
43
54namespace Intersect . GameObjects . Conditions ;
65
@@ -48,35 +47,4 @@ public string Data()
4847 }
4948 ) ;
5049 }
51- }
52-
53- public partial class ConditionListsSerializer : JsonConverter
54- {
55- public override bool CanConvert ( Type objectType )
56- {
57- return true ;
58- }
59-
60- public override object ReadJson (
61- JsonReader reader ,
62- Type objectType ,
63- object existingValue ,
64- JsonSerializer serializer
65- )
66- {
67- var jsonObject = JObject . Load ( reader ) ;
68- var properties = jsonObject . Properties ( ) . ToList ( ) ;
69- var lists = existingValue != null ? ( ConditionLists ) existingValue : new ConditionLists ( ) ;
70- lists . Load ( ( string ) properties [ 0 ] . Value ) ;
71-
72- return lists ;
73- }
74-
75- public override void WriteJson ( JsonWriter writer , object value , JsonSerializer serializer )
76- {
77- writer . WriteStartObject ( ) ;
78- writer . WritePropertyName ( "Lists" ) ;
79- serializer . Serialize ( writer , ( ( ConditionLists ) value ) . Data ( ) ) ;
80- writer . WriteEndObject ( ) ;
81- }
82- }
50+ }
Original file line number Diff line number Diff line change 1+ using Newtonsoft . Json ;
2+ using Newtonsoft . Json . Linq ;
3+
4+ namespace Intersect . GameObjects . Conditions ;
5+
6+ public partial class ConditionListsSerializer : JsonConverter
7+ {
8+ public override bool CanConvert ( Type objectType )
9+ {
10+ return true ;
11+ }
12+
13+ public override object ReadJson (
14+ JsonReader reader ,
15+ Type objectType ,
16+ object existingValue ,
17+ JsonSerializer serializer
18+ )
19+ {
20+ var jsonObject = JObject . Load ( reader ) ;
21+ var properties = jsonObject . Properties ( ) . ToList ( ) ;
22+ var lists = existingValue != null ? ( ConditionLists ) existingValue : new ConditionLists ( ) ;
23+ lists . Load ( ( string ) properties [ 0 ] . Value ) ;
24+
25+ return lists ;
26+ }
27+
28+ public override void WriteJson ( JsonWriter writer , object value , JsonSerializer serializer )
29+ {
30+ writer . WriteStartObject ( ) ;
31+ writer . WritePropertyName ( "Lists" ) ;
32+ serializer . Serialize ( writer , ( ( ConditionLists ) value ) . Data ( ) ) ;
33+ writer . WriteEndObject ( ) ;
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments