54 lines
1.2 KiB
Lua
54 lines
1.2 KiB
Lua
|
------------------------------------------------
|
||
|
--作者: 杨全福
|
||
|
--日期: 2020-08-19
|
||
|
--文件: SoulMonsterInfo.lua
|
||
|
--模块: SoulMonsterInfo
|
||
|
--描述: 神兽岛boss数据
|
||
|
------------------------------------------------
|
||
|
|
||
|
local SoulMonsterInfo = {
|
||
|
--配置
|
||
|
BossCfg = nil,
|
||
|
--刷新时间
|
||
|
RefreshTime = 0,
|
||
|
SyncTime = 0,
|
||
|
--是否关注
|
||
|
IsFollowed = false,
|
||
|
--类型
|
||
|
Type = 0,
|
||
|
--数量
|
||
|
Num = 0,
|
||
|
--是否显示
|
||
|
IsShow = false,
|
||
|
}
|
||
|
|
||
|
function SoulMonsterInfo:New(cfg)
|
||
|
local _m = Utils.DeepCopy(self)
|
||
|
_m.BossCfg = cfg
|
||
|
_m.RefreshTime = 0
|
||
|
_m.SyncTime = 0
|
||
|
_m.IsFollowed = false
|
||
|
_m.Type = 0
|
||
|
_m.Num = 0
|
||
|
_m.IsShow = true
|
||
|
return _m
|
||
|
end
|
||
|
|
||
|
function SoulMonsterInfo:Refresh(msg)
|
||
|
self.RefreshTime = msg.refreshTime
|
||
|
self.SyncTime = Time.GetRealtimeSinceStartup()
|
||
|
self.IsFollow = msg.isFollowed
|
||
|
self.Type = msg.type
|
||
|
self.Num = msg.num
|
||
|
self.IsShow = true
|
||
|
end
|
||
|
|
||
|
function SoulMonsterInfo:GetRefreshTime()
|
||
|
local _result = self.RefreshTime - (Time.GetRealtimeSinceStartup() - self.SyncTime)
|
||
|
if _result < 0 then
|
||
|
_result = 0
|
||
|
end
|
||
|
return _result
|
||
|
end
|
||
|
|
||
|
return SoulMonsterInfo
|