Files
Main/Assets/GameAssets/Resources/Lua/Logic/ServerActive/ServerActiveTaskData.lua
2025-01-25 04:38:09 +08:00

49 lines
1.2 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

------------------------------------------------
--作者: 王圣
--日期: 2019-07-19
--文件: ServerActiveTaskData.lua
--模块: ServerActiveTaskData
--描述: 开服活动任务数据
------------------------------------------------
--引用
local ServerActiveTaskData = {
--配置表id
CfgId = 0,
--当前完成度
CurNum = 0,
--总次数
TotalNum = 0,
--剩余份数
LeftNum = 0,
--领取状态 0: 没有达到要求 1可以领取 2已领取
RewardState = 0,
--条件描述
Condition = nil,
--是否限制领取
IsLimit = false,
--奖励道具List
ItemList = List:New()
}
function ServerActiveTaskData:New()
local _m = Utils.DeepCopy(self)
return _m
end
function ServerActiveTaskData:Parase(cfg)
self.CfgId = cfg.Id
local list = Utils.SplitStr(cfg.Condition,'_')
if list ~= nil then
self.TotalNum = tonumber(list[#list])
end
--设置是否限制
self.IsLimit = cfg.LimitTime ~= 0
self.Condition = cfg.Des
end
function ServerActiveTaskData:ParaseMsg(msg)
self.CurNum = msg.progress
self.RewardState = msg.state
self.LeftNum = msg.remain
end
return ServerActiveTaskData