From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/GVGDuelCombatInfo.cs | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs (limited to 'Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs') diff --git a/Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs b/Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs new file mode 100644 index 00000000..35d31385 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs @@ -0,0 +1,108 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class GVGDuelCombatInfo + { + public uint roomID; + + public ulong GuildID; + + public uint GuildScore; + + public string GuildName; + + public uint GuildIcon; + + public uint CombatTime; + + public ulong ServerID; + + public bool Winner; + + public bool isShow = false; + + public GVGDuelStatu gs = GVGDuelStatu.IDLE; + + public GVGDuelCombatInfo.GVGDuelCombatStatu Statu = GVGDuelCombatInfo.GVGDuelCombatStatu.Next; + + public uint AddScore = 0u; + + public enum GVGDuelCombatStatu + { + Used, + Current, + Next + } + + public string GetPortraitName() + { + return XGuildDocument.GetPortraitName((int)this.GuildIcon); + } + + public bool Pass() + { + return this.GuildID > 0UL; + } + + public void Setup(CrossGvgRacePointRecord cgrp) + { + this.roomID = cgrp.roomid; + this.CombatTime = cgrp.time; + this.GuildID = cgrp.opponent.guildid; + this.GuildName = cgrp.opponent.guildname; + this.GuildScore = cgrp.opponent.score; + this.GuildIcon = cgrp.opponent.icon; + this.ServerID = (ulong)cgrp.opponent.serverid; + this.Winner = cgrp.iswin; + this.AddScore = cgrp.addscore; + this.Convert(cgrp.state); + } + + public void Convert(CrossGvgRoomState room) + { + switch (room) + { + case CrossGvgRoomState.CGRS_Idle: + this.gs = GVGDuelStatu.IDLE; + break; + case CrossGvgRoomState.CGRS_Fighting: + this.gs = GVGDuelStatu.FIGHTING; + break; + case CrossGvgRoomState.CGRS_Finish: + this.gs = GVGDuelStatu.FINISH; + break; + default: + this.gs = GVGDuelStatu.IDLE; + break; + } + } + + public string GetGuildName() + { + bool flag = this.GuildID > 0UL; + string @string; + if (flag) + { + @string = XStringDefineProxy.GetString("CROSS_GVG_GUILDNAME", new object[] + { + this.ServerID, + this.GuildName + }); + } + else + { + @string = XStringDefineProxy.GetString("GUILD_ARENA_UNCOMBAT"); + } + return @string; + } + + public string ToTimeString() + { + return XSingleton.singleton.TimeFormatSince1970((int)this.CombatTime, XStringDefineProxy.GetString("TIME_FORMAT_YYMMDD"), true); + } + } +} -- cgit v1.1-26-g67d0