summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/GVGDuelResult.cs
blob: ff1ac0fb3cd1b229b61c635ac8ec427800453b24 (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
using System;
using System.Collections.Generic;
using KKSG;

namespace XMainClient
{
	public class GVGDuelResult
	{
		public bool isWinner
		{
			get
			{
				return this._winer;
			}
		}

		public GmfGuildBrief Guild
		{
			get
			{
				return this._guild;
			}
		}

		public uint Score
		{
			get
			{
				return this._score;
			}
		}

		public uint TotalKiller = 0u;

		public double TotalDamage = 0.0;

		public List<GmfRoleCombat> RoleCombats;

		public GuildArenaBattlePattern pattern;

		private GmfGuildBrief _guild;

		private bool _cross = false;

		private uint _score = 0u;

		private bool _winer = false;

		public void Setup(GmfGuildBrief guild, List<GmfRoleCombat> combats, bool winer, bool cross = false)
		{
			this._winer = winer;
			this._cross = cross;
			this._guild = guild;
			this.SetRoleCombats(combats);
		}

		public void Setup(GmfGuildBrief guild, uint score, bool winer, bool cross = false)
		{
			this._winer = winer;
			this._guild = guild;
			this._score = score;
			this._cross = cross;
		}

		private void SetRoleCombats(List<GmfRoleCombat> combats)
		{
			this.RoleCombats = combats;
			this.TotalKiller = 0u;
			this.TotalDamage = 0.0;
			int i = 0;
			int count = combats.Count;
			while (i < count)
			{
				this.TotalKiller += combats[i].combat.killcount;
				this.TotalDamage += combats[i].combat.damage;
				i++;
			}
		}

		public string ToGuildNameString()
		{
			bool cross = this._cross;
			string result;
			if (cross)
			{
				result = XStringDefineProxy.GetString("CROSS_GVG_GUILDNAME", new object[]
				{
					this._guild.serverid,
					this._guild.guildname
				});
			}
			else
			{
				result = this.Guild.guildname;
			}
			return result;
		}
	}
}