summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/Rpc/IRpc.cs
blob: ee35dab1fe2cc3bdb8a32cdda45b9a0f724c9d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
namespace UniJSON
{
    public interface IRpc
    {
        void Request(Utf8String method);
        void Request<A0>(Utf8String method, A0 a0);
        void Request<A0, A1>(Utf8String method, A0 a0, A1 a1);
        void Request<A0, A1, A2>(Utf8String method, A0 a0, A1 a1, A2 a2);
        void Request<A0, A1, A2, A3>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3);
        void Request<A0, A1, A2, A3, A4>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4);
        void Request<A0, A1, A2, A3, A4, A5>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5);
        void ResponseSuccess(int id);
        void ResponseSuccess<T>(int id, T result);
        void ResponseError(int id, System.Exception error);
        void Notify(Utf8String method);
        void Notify<A0>(Utf8String method, A0 a0);
        void Notify<A0, A1>(Utf8String method, A0 a0, A1 a1);
        void Notify<A0, A1, A2>(Utf8String method, A0 a0, A1 a1, A2 a2);
        void Notify<A0, A1, A2, A3>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3);
        void Notify<A0, A1, A2, A3, A4>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4);
        void Notify<A0, A1, A2, A3, A4, A5>(Utf8String method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5);
    }

    public static class RpcExtensions
    {
        public static void Request(this IRpc rpc, string method)
        {
            rpc.Request(Utf8String.From(method));
        }
        public static void Request<A0>(this IRpc rpc, string method, A0 a0)
        {
            rpc.Request(Utf8String.From(method), a0);
        }
        public static void Request<A0, A1>(this IRpc rpc, string method, A0 a0, A1 a1)
        {
            rpc.Request(Utf8String.From(method), a0, a1);
        }
        public static void Request<A0, A1, A2>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2)
        {
            rpc.Request(Utf8String.From(method), a0, a1, a2);
        }
        public static void Request<A0, A1, A2, A3>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3)
        {
            rpc.Request(Utf8String.From(method), a0, a1, a2, a3);
        }
        public static void Request<A0, A1, A2, A3, A4>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
        {
            rpc.Request(Utf8String.From(method), a0, a1, a2, a3, a4);
        }
        public static void Request<A0, A1, A2, A3, A4, A5>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
        {
            rpc.Request(Utf8String.From(method), a0, a1, a2, a3, a4, a5);
        }

        public static void Notify(this IRpc rpc, string method)
        {
            rpc.Notify(Utf8String.From(method));
        }
        public static void Notify<A0>(this IRpc rpc, string method, A0 a0)
        {
            rpc.Notify(Utf8String.From(method), a0);
        }
        public static void Notify<A0, A1>(this IRpc rpc, string method, A0 a0, A1 a1)
        {
            rpc.Notify(Utf8String.From(method), a0, a1);
        }
        public static void Notify<A0, A1, A2>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2)
        {
            rpc.Notify(Utf8String.From(method), a0, a1, a2);
        }
        public static void Notify<A0, A1, A2, A3>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3)
        {
            rpc.Notify(Utf8String.From(method), a0, a1, a2, a3);
        }
        public static void Notify<A0, A1, A2, A3, A4>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
        {
            rpc.Notify(Utf8String.From(method), a0, a1, a2, a3, a4);
        }
        public static void Notify<A0, A1, A2, A3, A4, A5>(this IRpc rpc, string method, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
        {
            rpc.Notify(Utf8String.From(method), a0, a1, a2, a3, a4, a5);
        }
    }
}