diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs new file mode 100644 index 00000000..e8ed5ef7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs @@ -0,0 +1,118 @@ +using System;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ public class XGuildSalaryInfo
+ {
+ public uint Score
+ {
+ get
+ {
+ return this.m_score;
+ }
+ }
+
+ public uint TotalScore
+ {
+ get
+ {
+ return this.m_totalScore;
+ }
+ }
+
+ public uint Grade
+ {
+ get
+ {
+ return this.m_grade;
+ }
+ }
+
+ public uint Value
+ {
+ get
+ {
+ return this.m_value;
+ }
+ }
+
+ public float Percent
+ {
+ get
+ {
+ return this.m_Percent;
+ }
+ }
+
+ private uint m_score = 0u;
+
+ private uint m_totalScore = 0u;
+
+ private uint m_grade = 0u;
+
+ private uint m_value;
+
+ private float m_Percent = 0f;
+
+ public void Init(uint value, GuildSalaryTable.RowData rowData, uint index)
+ {
+ this.m_value = value;
+ bool flag = rowData == null;
+ if (!flag)
+ {
+ switch (index)
+ {
+ case 0u:
+ this.CalculateScore(ref rowData.NumberTransformation, value);
+ break;
+ case 1u:
+ this.CalculateScore(ref rowData.PrestigeTransformation, value);
+ break;
+ case 2u:
+ this.CalculateScore(ref rowData.ActiveTransformation, value);
+ break;
+ case 3u:
+ this.CalculateScore(ref rowData.EXPTransformation, value);
+ break;
+ }
+ this.CalculateGrade(rowData.GuildReview, this.m_score);
+ }
+ }
+
+ private void CalculateScore(ref SeqListRef<uint> transformation, uint value)
+ {
+ uint num = transformation[0, 0];
+ uint num2 = transformation[0, 1];
+ uint num3 = transformation[1, 0];
+ uint num4 = transformation[1, 1];
+ this.m_totalScore = num2;
+ bool flag = value > num2;
+ if (flag)
+ {
+ value = num2;
+ }
+ this.m_Percent = value / num2;
+ float num5 = this.m_Percent * num4;
+ this.m_score = (uint)Math.Floor((double)num5);
+ }
+
+ private void CalculateGrade(uint[] scores, uint cur)
+ {
+ this.m_grade = 1u;
+ bool flag = scores != null;
+ if (flag)
+ {
+ for (int i = scores.Length - 1; i >= 0; i--)
+ {
+ bool flag2 = cur < scores[i];
+ if (!flag2)
+ {
+ break;
+ }
+ this.m_grade += 1u;
+ }
+ }
+ }
+ }
+}
|