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

49 lines
1.2 KiB
Lua

------------------------------------------------
--作者: 王圣
--日期: 2019-07-19
--文件: ServerActiveComData.lua
--模块: ServerActiveComData
--描述: 开服活动通用数据模型
------------------------------------------------
--引用
local ActiveTaskData = require "Logic.ServerActive.ServerActiveTaskData"
local ServerActiveComData = {
--标题图片名字
TextureName = nil,
--标题描述
TitleDes = nil,
--任务列表
ListTask = List:New()
}
function ServerActiveComData:New()
local _m = Utils.DeepCopy(self)
return _m
end
function ServerActiveComData:ParaseCfg(cfg)
if cfg == nil then
return
end
local task = ActiveTaskData:New()
task:Parase(cfg)
self.ListTask:Add(task)
end
--解析服务器消息
function ServerActiveComData:ParaseMsg(msg)
for i = 1,#self.ListTask do
if self.ListTask[i].CfgId == msg.id then
self.ListTask[i]:ParaseMsg(msg)
break
end
end
end
--添加数据
function ServerActiveComData:AddData(cfg)
local task = ActiveTaskData:New()
task:Parase(cfg)
self.ListTask:Add(task)
end
return ServerActiveComData