@@ -8,7 +8,8 @@ namespace com.tvd12.ezyfoxserver.client.unity
8
8
{
9
9
public sealed class EzyEventWSDataDeserializer
10
10
{
11
- private static readonly Dictionary < String , EzyEventType > EVENT_TYPE_BY_STRING_VALUE = new ( )
11
+ private static readonly Dictionary < String , EzyEventType >
12
+ EVENT_TYPE_BY_STRING_VALUE = new ( )
12
13
{
13
14
{ "CONNECTION_SUCCESS" , EzyEventType . CONNECTION_SUCCESS } ,
14
15
{ "CONNECTION_FAILURE" , EzyEventType . CONNECTION_FAILURE } ,
@@ -17,7 +18,8 @@ public sealed class EzyEventWSDataDeserializer
17
18
{ "TRY_CONNECT" , EzyEventType . TRY_CONNECT } ,
18
19
} ;
19
20
20
- private static readonly Dictionary < String , EzyConnectionFailedReason > CONNECTION_FAILED_REASON_BY_STRING_VALUE = new ( )
21
+ private static readonly Dictionary < String , EzyConnectionFailedReason >
22
+ CONNECTION_FAILED_REASON_BY_STRING_VALUE = new ( )
21
23
{
22
24
{ "TIME_OUT" , EzyConnectionFailedReason . TIME_OUT } ,
23
25
{ "NETWORK_UNREACHABLE" , EzyConnectionFailedReason . NETWORK_UNREACHABLE } ,
@@ -26,7 +28,8 @@ public sealed class EzyEventWSDataDeserializer
26
28
{ "UNKNOWN" , EzyConnectionFailedReason . UNKNOWN } ,
27
29
} ;
28
30
29
- private static readonly Dictionary < EzyEventType , EventDeserializer > DESERIALIZER_BY_EVENT_TYPE = new ( )
31
+ private static readonly Dictionary < EzyEventType , EventDeserializer >
32
+ DESERIALIZER_BY_EVENT_TYPE = new ( )
30
33
{
31
34
{ EzyEventType . CONNECTION_SUCCESS , _ => new EzyConnectionSuccessEvent ( ) } ,
32
35
{
@@ -56,15 +59,20 @@ public sealed class EzyEventWSDataDeserializer
56
59
)
57
60
}
58
61
} ;
62
+
59
63
private delegate EzyEvent EventDeserializer ( String jsonData ) ;
64
+
60
65
private static readonly EzyEventWSDataDeserializer INSTANCE = new ( ) ;
61
66
62
67
public static EzyEventWSDataDeserializer getInstance ( )
63
68
{
64
69
return INSTANCE ;
65
70
}
66
71
67
- public EzyEvent deserializeEvent ( String eventTypeStringValue , String jsonData )
72
+ public EzyEvent deserializeEvent (
73
+ String eventTypeStringValue ,
74
+ String jsonData
75
+ )
68
76
{
69
77
var eventType = EVENT_TYPE_BY_STRING_VALUE [ eventTypeStringValue ] ;
70
78
return DESERIALIZER_BY_EVENT_TYPE [ eventType ] . Invoke ( jsonData ) ;
0 commit comments