PGRData/Resources/Scripts/XEntity/XItem/XGiftTemplate.lua

22 lines
536 B
Lua
Raw Normal View History

2022-12-26 08:36:01 +00:00
local XGiftTemplate = {}
function XGiftTemplate.New(itemTemplate)
local extendObj = {
GiftType = itemTemplate.SubTypeParams[1],
RewardId = itemTemplate.SubTypeParams[2],
SelectCount = itemTemplate.SubTypeParams[3],
}
return setmetatable({}, {
__metatable = false,
__index = function(_, k)
if extendObj[k] ~= nil then
return extendObj[k]
else
return itemTemplate[k]
end
end,
})
end
return XGiftTemplate