summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XRollDocument.cs
blob: 36032d2aec4cf895b55357ab610ecc37bd093a5d (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
using System;
using KKSG;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

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

		public uint RollItemID
		{
			get
			{
				bool flag = this._current_roll_info == null;
				uint result;
				if (flag)
				{
					result = 0u;
				}
				else
				{
					result = this._current_roll_info.id;
				}
				return result;
			}
		}

		public uint RollItemCount
		{
			get
			{
				bool flag = this._current_roll_info == null;
				uint result;
				if (flag)
				{
					result = 0u;
				}
				else
				{
					result = this._current_roll_info.count;
				}
				return result;
			}
		}

		public float LastRollTime
		{
			get
			{
				return this._last_roll_time;
			}
		}

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

		private EnemyDoodadInfo _current_roll_info;

		public int ClientRollTime = 0;

		private float _last_roll_time = 0f;

		public void SendRollReq(int type)
		{
			RpcC2G_ChooseRollReq rpcC2G_ChooseRollReq = new RpcC2G_ChooseRollReq();
			rpcC2G_ChooseRollReq.oArg.info = this._current_roll_info;
			rpcC2G_ChooseRollReq.oArg.chooseType = type;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2G_ChooseRollReq);
		}

		public void SetRollItem(EnemyDoodadInfo info)
		{
			bool flag = this.ClientRollTime == 0;
			if (flag)
			{
				this.ClientRollTime = XSingleton<XGlobalConfig>.singleton.GetInt("ClientRollTime");
			}
			this._last_roll_time = Time.time;
			this._current_roll_info = info;
			DlgBase<RollDlg, RollDlgBehaviour>.singleton.ShowRollInfo();
		}

		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
		}
	}
}