summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/StrengthAuxData.cs
blob: 3ce79ed74be1f2ac99c218d94c7108b7330ff933 (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
using System;
using System.Collections.Generic;
using XUtliPoolLib;

namespace XMainClient
{
	public class StrengthAuxData
	{
		public int Id
		{
			get
			{
				return this.m_StrengthenData.BQID;
			}
		}

		public uint FightNum
		{
			get
			{
				return this.m_iFightNum;
			}
			set
			{
				this.m_iFightNum = value;
				this._fightPercent = 0.0;
			}
		}

		public double FightPercent
		{
			get
			{
				return this._fightPercent;
			}
			set
			{
				this._fightPercent = value;
			}
		}

		public FpStrengthNew.RowData StrengthenData
		{
			get
			{
				return this.m_StrengthenData;
			}
		}

		public bool IsShow
		{
			get
			{
				bool flag = this.StrengthenData == null;
				return !flag && XSingleton<XGameSysMgr>.singleton.IsSystemOpened((XSysDefine)this.StrengthenData.BQSystem) && (long)this.StrengthenData.ShowLevel <= (long)((ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level);
			}
		}

		private uint m_iFightNum = 0u;

		private double _fightPercent = 0.0;

		private FpStrengthNew.RowData m_StrengthenData = null;

		public StrengthAuxData(FpStrengthNew.RowData data)
		{
			this.m_StrengthenData = data;
		}

		public double GetFightPercent(int recommendFight)
		{
			bool flag = recommendFight == 0;
			double result;
			if (flag)
			{
				result = 0.0;
			}
			else
			{
				result = this.FightNum / (double)recommendFight * 100.0;
			}
			return result;
		}

		private FpStrengthNew.RowData GetData(int id)
		{
			List<FpStrengthNew.RowData> list = new List<FpStrengthNew.RowData>();
			for (int i = 0; i < XFPStrengthenDocument.StrengthenReader.Table.Length; i++)
			{
				FpStrengthNew.RowData rowData = XFPStrengthenDocument.StrengthenReader.Table[i];
				bool flag = rowData.BQID == id;
				if (flag)
				{
					return rowData;
				}
			}
			return null;
		}
	}
}