summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UIBuffInfo.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UIBuffInfo.cs85
1 files changed, 85 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs b/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs
new file mode 100644
index 00000000..50ade5e0
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs
@@ -0,0 +1,85 @@
+using System;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class UIBuffInfo
+ {
+ public uint buffID;
+
+ public uint buffLevel;
+
+ public float leftTime;
+
+ public float startTime;
+
+ public double HP;
+
+ public double maxHP;
+
+ public ulong mobUID;
+
+ public bool bReduceCD;
+
+ public int transformID;
+
+ public uint stackCount;
+
+ public BuffTable.RowData buffInfo;
+
+ public static UIBuffInfo Create(XBuff buff)
+ {
+ UIBuffInfo uibuffInfo = new UIBuffInfo();
+ uibuffInfo.Set(buff);
+ return uibuffInfo;
+ }
+
+ public void Set(XBuff buff)
+ {
+ this.buffID = (uint)buff.ID;
+ this.buffLevel = (uint)buff.Level;
+ this.leftTime = buff.GetLeftTime();
+ this.startTime = Time.time;
+ this.HP = buff.HP;
+ this.maxHP = buff.MaxHP;
+ this.mobUID = buff.EffectData.MobID;
+ this.stackCount = buff.StackCount;
+ this.buffInfo = buff.BuffInfo;
+ }
+
+ public static UIBuffInfo Create(ServerBuffInfo buff)
+ {
+ UIBuffInfo uibuffInfo = new UIBuffInfo();
+ uibuffInfo.Set(buff);
+ return uibuffInfo;
+ }
+
+ public bool Set(ServerBuffInfo buff)
+ {
+ this.buffID = buff.buffID;
+ this.buffLevel = buff.buffLevel;
+ this.leftTime = buff.leftTime;
+ this.startTime = Time.realtimeSinceStartup;
+ this.HP = buff.HP;
+ this.maxHP = buff.maxHP;
+ this.mobUID = buff.mobUID;
+ this.bReduceCD = buff.bReduceCD;
+ this.transformID = buff.transformID;
+ this.stackCount = buff.stackCount;
+ this.buffInfo = XSingleton<XBuffTemplateManager>.singleton.GetBuffData((int)this.buffID, (int)this.buffLevel);
+ bool flag = this.buffInfo == null;
+ bool result;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog(string.Format("Set Server Buff data not found: [{0} {1}]", this.buffID, this.buffLevel), null, null, null, null, null);
+ result = false;
+ }
+ else
+ {
+ result = true;
+ }
+ return result;
+ }
+ }
+}