summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/GVGDuelCombatInfo.cs
blob: 35d31385794f7afc7552f36ea2fabc1861209519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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<UiUtility>.singleton.TimeFormatSince1970((int)this.CombatTime, XStringDefineProxy.GetString("TIME_FORMAT_YYMMDD"), true);
		}
	}
}