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/XBattleStatistics.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XBattleStatistics.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XBattleStatistics.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XBattleStatistics.cs b/Client/Assets/Scripts/XMainClient/XBattleStatistics.cs new file mode 100644 index 00000000..3a2f9679 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XBattleStatistics.cs @@ -0,0 +1,76 @@ +using System;
+using UnityEngine;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient
+{
+ internal struct XBattleStatistics
+ {
+ public double Dps
+ {
+ get
+ {
+ return (this.m_TimeTotal > 0f) ? (this.m_Damage / (double)this.m_TimeTotal) : 0.0;
+ }
+ }
+
+ public double PrintDamage
+ {
+ get
+ {
+ return this.m_Damage - this.m_StartPrintDamage;
+ }
+ }
+
+ private double m_Damage;
+
+ private double m_StartPrintDamage;
+
+ private float m_TimeTotal;
+
+ private float m_TimeBase;
+
+ private float m_TimeEnd;
+
+ public void Reset()
+ {
+ this.m_Damage = 0.0;
+ this.m_TimeTotal = 0f;
+ }
+
+ public void AppendDamage(double damage)
+ {
+ this.m_Damage += damage;
+ }
+
+ public void AppendTime()
+ {
+ float time = Time.time;
+ this.m_TimeTotal += time - this.m_TimeBase;
+ this.m_TimeBase = time;
+ }
+
+ public void MarkTimeBaseLine()
+ {
+ this.m_TimeBase = Time.time - this.m_TimeEnd;
+ }
+
+ public void MarkTimEndLine()
+ {
+ this.m_TimeEnd = Time.time - this.m_TimeBase;
+ }
+
+ public void StartPrintDamage(float time)
+ {
+ this.m_StartPrintDamage = this.m_Damage;
+ XCombatStatisticsDocument specificDocument = XDocuments.GetSpecificDocument<XCombatStatisticsDocument>(XCombatStatisticsDocument.uuID);
+ specificDocument.bShowDamage = true;
+ }
+
+ public void StopPrintDamage()
+ {
+ DlgBase<DemoUI, DemoUIBehaviour>.singleton.AddMessage((this.m_Damage - this.m_StartPrintDamage).ToString("F1"));
+ }
+ }
+}
|