summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs
blob: 810dc1a23a0d9fc72376ad56cc410e2345b62685 (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
using System;
using KKSG;
using UnityEngine;

namespace XMainClient
{
	internal class XGuildRedPacketBrief : IComparable<XGuildRedPacketBrief>
	{
		public uint typeid;

		public ulong uid;

		public int itemid;

		public string senderName;

		public uint fetchedCount;

		public uint maxCount;

		public float endTime;

		public string iconUrl;

		public ulong sourceID;

		public string sourceName;

		public FetchState fetchState;

		public void SetData(GuildBonusAppear data)
		{
			this.uid = (ulong)data.bonusID;
			this.itemid = (int)data.bonusType;
			this.senderName = data.sourceName;
			this.fetchedCount = data.alreadyGetPeopleNum;
			this.maxCount = data.maxPeopleNum;
			this.iconUrl = data.iconUrl;
			this.sourceID = data.sourceID;
			this.sourceName = data.sourceName;
			bool flag = data.bonusStatus == 0u;
			if (flag)
			{
				this.fetchState = FetchState.FS_CAN_FETCH;
			}
			else
			{
				bool flag2 = data.bonusStatus == 1u;
				if (flag2)
				{
					this.fetchState = FetchState.FS_CANNOT_FETCH;
				}
				else
				{
					bool flag3 = data.bonusStatus == 2u;
					if (flag3)
					{
						this.fetchState = FetchState.FS_ALREADY_FETCH;
					}
					else
					{
						this.fetchState = FetchState.FS_FETCHED;
					}
				}
			}
			this.endTime = Time.time + data.leftOpenTime;
		}

		public int CompareTo(XGuildRedPacketBrief other)
		{
			bool flag = this.fetchState == other.fetchState;
			int result;
			if (flag)
			{
				result = this.endTime.CompareTo(other.endTime);
			}
			else
			{
				result = this.fetchState.CompareTo(other.fetchState);
			}
			return result;
		}
	}
}