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/GVGBattleInfo.cs | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs (limited to 'Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs') diff --git a/Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs b/Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs new file mode 100644 index 00000000..8089b9da --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using KKSG; + +namespace XMainClient +{ + public class GVGBattleInfo + { + public List Group + { + get + { + return this._groups; + } + } + + public GmfGuildBrief Base + { + get + { + return this._groupBase; + } + } + + public uint Inspire + { + get + { + return this._inspire; + } + } + + public int Size + { + get + { + return this._groups.Count; + } + } + + public bool Empty + { + get + { + return this.Size == 0; + } + } + + private List _groups = new List(); + + private GmfGuildBrief _groupBase; + + private uint _inspire; + + private List _roleCombat; + + public void Convert(GmfHalfRoles info) + { + this._groups.Clear(); + this._groups.AddRange(info.roles); + this._groupBase = info.guildb; + this._inspire = info.inspire; + } + + public void Convert(List combats) + { + this._roleCombat = combats; + } + + public bool TryGetMember(ulong uid, out GmfRole member) + { + member = null; + int i = 0; + int count = this._groups.Count; + while (i < count) + { + bool flag = uid == this._groups[i].roleID; + if (flag) + { + member = this._groups[i]; + return true; + } + i++; + } + return false; + } + + public bool TryGetCombat(ulong uid, out GmfCombat combat) + { + combat = null; + bool flag = this._roleCombat == null; + bool result; + if (flag) + { + result = false; + } + else + { + int i = 0; + int count = this._roleCombat.Count; + while (i < count) + { + bool flag2 = this._roleCombat[i].gmfrole != null && this._roleCombat[i].gmfrole.roleid == uid; + if (flag2) + { + combat = this._roleCombat[i].combat; + return true; + } + i++; + } + result = false; + } + return result; + } + } +} -- cgit v1.1-26-g67d0