38 lines
867 B
Lua
38 lines
867 B
Lua
|
|
------------------------------------------------
|
|
--作者: 王圣
|
|
--日期: 2019-07-20
|
|
--文件: ServeRedPacketData.lua
|
|
--模块: ServeRedPacketData
|
|
--描述: 开服活动七日红包数据
|
|
------------------------------------------------
|
|
--引用
|
|
local ServeRedPacketData = {
|
|
--索引
|
|
Index = 0,
|
|
--存入比例
|
|
Percent = 0,
|
|
--Gold图标
|
|
GoldIcon = 0,
|
|
--元宝数量
|
|
GoldNum = 0,
|
|
}
|
|
function ServeRedPacketData:New()
|
|
local _m = Utils.DeepCopy(self)
|
|
return _m
|
|
end
|
|
|
|
function ServeRedPacketData:Parase(str, index)
|
|
self.Index = index
|
|
local list = Utils.SplitStr(str,'_')
|
|
if list ~= nil then
|
|
self.Index = tonumber(list[1])
|
|
self.Percent = tonumber(list[2])/10000
|
|
end
|
|
end
|
|
|
|
--解析服务器消息
|
|
function ServeRedPacketData:ParaseMsg(num)
|
|
self.GoldNum = num
|
|
end
|
|
return ServeRedPacketData |