summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs
blob: c65d78be3657b6d3754eba13366e46db2e58c7fe (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.Reflection;
using KKSG;
using XMainClient.UI;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XYorozuyaDocument : XDocComponent
	{
		public override uint ID
		{
			get
			{
				return XYorozuyaDocument.uuID;
			}
		}

		public byte SelectID { get; set; }

		public static XYorozuyaDocument Doc
		{
			get
			{
				return XSingleton<XGame>.singleton.Doc.GetXComponent(XYorozuyaDocument.uuID) as XYorozuyaDocument;
			}
		}

		public YorozuyaTable YorozuyaTab
		{
			get
			{
				return XYorozuyaDocument.m_yorozuyaTab;
			}
		}

		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("XYorozuyaDocument");

		public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();

		private static YorozuyaTable m_yorozuyaTab = new YorozuyaTable();

		public static void Execute(OnLoadedCallback callback = null)
		{
			XYorozuyaDocument.AsyncLoader.AddTask("Table/Yorozuya", XYorozuyaDocument.m_yorozuyaTab, false);
			XYorozuyaDocument.AsyncLoader.Execute(callback);
		}

		public static void OnTableLoaded()
		{
		}

		public override void OnAttachToHost(XObject host)
		{
			base.OnAttachToHost(host);
		}

		protected override void EventSubscribe()
		{
			base.EventSubscribe();
		}

		public override void OnDetachFromHost()
		{
			base.OnDetachFromHost();
		}

		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
		}

		public override void OnEnterSceneFinally()
		{
			base.OnEnterSceneFinally();
		}

		public void ReqEnterScene(int id)
		{
			RpcC2G_EnterLeisureScene rpcC2G_EnterLeisureScene = new RpcC2G_EnterLeisureScene();
			rpcC2G_EnterLeisureScene.oArg.index = id;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2G_EnterLeisureScene);
		}

		public YorozuyaTable.RowData GetRowData(byte id)
		{
			return XYorozuyaDocument.m_yorozuyaTab.GetByID(id);
		}

		public void OnReqBack(EnterLeisureSceneRes oRes)
		{
			bool flag = oRes.errorcode == ErrorCode.ERR_INVALID_REQUEST;
			if (flag)
			{
				string fullName = MethodBase.GetCurrentMethod().ReflectedType.FullName;
				XSingleton<UiUtility>.singleton.OnGetInvalidRequest(fullName);
			}
			else
			{
				bool flag2 = oRes.errorcode > ErrorCode.ERR_SUCCESS;
				if (flag2)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.errorcode, "fece00");
				}
			}
		}
	}
}