From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Guild/XGuildMember.cs | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs (limited to 'Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs') diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs new file mode 100644 index 00000000..6c3331c3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs @@ -0,0 +1,114 @@ +using System; +using KKSG; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMember : XGuildMemberBasicInfo, IComparable + { + public uint contribution; + + public bool canSend; + + public uint taskLuck; + + public uint taskScore; + + public bool canRefresh; + + public FetchState fetchState; + + public void Set(GuildMemberData data) + { + this.uid = data.roleid; + this.name = data.name; + this.position = (GuildPosition)data.position; + this.ppt = data.ppt; + this.contribution = data.contribute; + this.level = data.level; + this.profession = XFastEnumIntEqualityComparer.ToInt(data.profession); + this.time = (int)data.lastlogin; + this.vip = data.vip; + this.paymemberid = data.paymemberid; + this.isOnline = data.isonline; + this.liveness = data.activity; + this.taskLuck = data.task_luck; + this.taskScore = data.task_score; + this.canRefresh = data.can_refresh; + bool flag = data.lastlogin == 0u; + if (flag) + { + this.time = XGuildMemberBasicInfo.ONLINE_TIME; + } + this.titleID = data.title; + this.canSend = (((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.SEND_FATIGUE))) > 0UL); + bool flag2 = ((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.RECV_FATIGUE))) > 0UL; + if (flag2) + { + this.fetchState = FetchState.FS_CAN_FETCH; + } + else + { + bool flag3 = ((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.RECVED_FATIGUE))) > 0UL; + if (flag3) + { + this.fetchState = FetchState.FS_FETCHED; + } + else + { + this.fetchState = FetchState.FS_CANNOT_FETCH; + } + } + } + + public int CompareTo(XGuildMember other) + { + bool flag = XGuildMemberBasicInfo.playerID != 0UL && this.uid != other.uid; + if (flag) + { + bool flag2 = this.uid == XGuildMemberBasicInfo.playerID; + if (flag2) + { + return -1; + } + bool flag3 = other.uid == XGuildMemberBasicInfo.playerID; + if (flag3) + { + return 1; + } + } + int num = 0; + GuildMemberSortType sortType = XGuildMemberBasicInfo.sortType; + if (sortType != GuildMemberSortType.GMST_CONTRIBUTION) + { + if (sortType == GuildMemberSortType.GMST_TASKSCORE) + { + bool flag4 = this.canRefresh ^ other.canRefresh; + if (flag4) + { + num = (this.canRefresh ? -1 : 1); + } + else + { + num = (int)(this.taskScore - other.taskScore); + } + } + } + else + { + num = this.contribution.CompareTo(other.contribution); + } + bool flag5 = num == 0; + int result; + if (flag5) + { + result = base.CompareTo(other); + } + else + { + result = num * XGuildMemberBasicInfo.dir; + } + return result; + } + } +} -- cgit v1.1-26-g67d0