------------------------------------------------ --作者: 陈宇 --日期: 2019-07-19 --文件: XianPoSyntheticData.lua --模块: XianPoSyntheticData --描述: 仙魄合成数据类 ------------------------------------------------ local XianPoSyntheticData = { CfgId = 0, --仙魄配置表id Name = "", --仙魄名字 typ = 0, --所属分类id typName = "", --所属分类名称 NeedXianPoIdCountList = List:New(), --合成所需仙魄的id => 数量字典 NeedItemId = 0, --合成所需道具id NeedItemNum = 0, --合成所需道具数量 SuccessPer = 0, --万分比 Limit = 0, --合成限制 } function XianPoSyntheticData:New() local _m = Utils.DeepCopy(self) return _m end function XianPoSyntheticData:SetAllData(data) self.CfgId = data.Id self.Name = data.TargetItems self.typ = data.Type self.typName = data.TypeName if data.Material1 ~= "" then local _xianPoList = Utils.SplitStrByTableS(data.Material1) for i=1,#_xianPoList do local _data = {Id = _xianPoList[i][1], NeedNum = _xianPoList[i][2]} self.NeedXianPoIdCountList:Add(_data) end end if data.Material2 ~= "" then local _itemList = Utils.SplitStrByTableS(data.Material2) self.NeedItemId = _itemList[1][1] self.NeedItemNum = _itemList[1][2] -- for i=1,#_itemList do -- if not self.NeedItemIdCountDic:ContainsKey(_itemList[i][1]) then -- self.NeedItemIdCountDic:Add(_itemList[i][1], _itemList[i][2]) -- end -- end end self.SuccessPer = data.Probability local _cfg = DataConfig.DataImmortalSoulAttribute[self.CfgId] if _cfg ~= nil then local limit = Utils.SplitNumber(_cfg.ExchangeConditions, '_') self.Limit = limit[2] end end return XianPoSyntheticData