From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/GroupMember.cs | 105 +++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GroupMember.cs (limited to 'Client/Assets/Scripts/XMainClient/GroupMember.cs') diff --git a/Client/Assets/Scripts/XMainClient/GroupMember.cs b/Client/Assets/Scripts/XMainClient/GroupMember.cs new file mode 100644 index 00000000..20b44412 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GroupMember.cs @@ -0,0 +1,105 @@ +using System; +using KKSG; + +namespace XMainClient +{ + public class GroupMember : IComparable + { + public int profession = 1; + + public string userName; + + public uint stageID; + + public ulong userID; + + public ulong groupID; + + public string groupName; + + public uint fightValue; + + public uint type; + + public uint timeIndex; + + public uint state; + + public uint createTime; + + public bool isselfingroup = false; + + public ulong issueIndex = 0UL; + + public static TitleSelector sortSeletor = TitleSelector.Nomal; + + public static int dir = -1; + + public void Setup(GroupChatFindRoleInfo info) + { + this.userID = info.roleid; + this.profession = (int)info.roleprofession; + this.userName = info.rolename; + this.groupID = info.groupchatID; + this.groupName = info.groupchatName; + this.stageID = info.stageID; + this.type = info.type; + this.fightValue = info.fighting; + this.timeIndex = info.time; + this.state = info.state; + this.createTime = info.issuetime; + this.issueIndex = info.issueIndex; + this.isselfingroup = false; + } + + public void Setup(GroupChatFindTeamInfo info) + { + this.userID = info.leaderroleid; + this.userName = ""; + this.profession = 1; + this.groupID = info.groupchatID; + this.groupName = info.groupchatName; + this.stageID = info.stageID; + this.type = info.type; + this.fightValue = info.fighting; + this.timeIndex = info.time; + this.state = info.state; + this.createTime = info.issuetime; + this.issueIndex = info.issueIndex; + this.isselfingroup = info.isselfingroup; + } + + public void Release() + { + GroupMemberPool.Release(this); + } + + public static GroupMember Get() + { + return GroupMemberPool.Get(); + } + + public int CompareTo(GroupMember other) + { + int num = 0; + switch (GroupMember.sortSeletor) + { + case TitleSelector.Stage: + num = this.stageID.CompareTo(other.stageID); + break; + case TitleSelector.Fight: + num = this.fightValue.CompareTo(other.fightValue); + break; + case TitleSelector.Time: + num = this.timeIndex.CompareTo(other.timeIndex); + break; + } + bool flag = num == 0; + if (flag) + { + num = this.createTime.CompareTo(other.createTime); + } + return num * GroupMember.dir; + } + } +} -- cgit v1.1-26-g67d0