From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Guild/XGuildRedPacketBrief.cs | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs (limited to 'Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs') diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs new file mode 100644 index 00000000..810dc1a2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs @@ -0,0 +1,84 @@ +using System; +using KKSG; +using UnityEngine; + +namespace XMainClient +{ + internal class XGuildRedPacketBrief : IComparable + { + 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; + } + } +} -- cgit v1.1-26-g67d0