summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/GVGBattleInfo.cs
blob: 8089b9dab1d5d9171e08e7651e15eae1e0f646ce (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
109
110
111
112
113
114
115
116
using System;
using System.Collections.Generic;
using KKSG;

namespace XMainClient
{
	public class GVGBattleInfo
	{
		public List<GmfRole> 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<GmfRole> _groups = new List<GmfRole>();

		private GmfGuildBrief _groupBase;

		private uint _inspire;

		private List<GmfRoleCombat> _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<GmfRoleCombat> 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;
		}
	}
}