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

37 lines
1.0 KiB
Lua
Raw Permalink 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.

------------------------------------------------
-- 作者: gzg
-- 日期: 2020-02-26
-- 文件: LuckyDrawAwardItem.lua
-- 模块: LuckyDrawAwardItem
-- 描述: 奖励物品
------------------------------------------------
local LuckyDrawAwardItem = {
CfgId = 0,
--索引
Index = 0,
--奖励类型0-4 特等奖 一等奖 二等级 三等奖
RewardType = 0,
--所有的奖励数据,根据服务器的下标获取到对应的Item
Rewards = nil,
--界面上要用的奖励数据 item_num_bind_occ_level
Item = nil,
}
function LuckyDrawAwardItem:New(cfg, index)
local _m = Utils.DeepCopy(self)
_m:RefeshData(cfg, index)
return _m
end
function LuckyDrawAwardItem:RefeshData(cfg, index)
if cfg ~= nil then
self.CfgId = cfg.Id
self.RewardType = cfg.Type
self.Rewards = Utils.SplitStr(cfg.RewardPool, ';');
self.Item = Utils.SplitNumber(self.Rewards[index + 1], '_')
self.Index = index
end
end
return LuckyDrawAwardItem;