local this = class("rogueEchoinfoTpl")

function this:init(config)
  self.data = config
end

function this:getTplById(id)
  return self.data[id]
end

function this:getFunctionDes(tpl)
  return L_Config:provider(tpl.fcuntionDes)
end

function this:getFunctionDesAdd(tpl)
  return L_Config:provider(tpl.fcuntionDesAdd)
end

function this:getType(tpl)
  return tpl.type
end

function this:getActTime(tpl)
  return tpl.actTime
end

function this:getId(tpl)
  return tpl.id
end

function this:getAbility(tpl)
  return tpl.ability
end

function this:getRarity(tpl)
  return tpl.rarity
end

function this:getName(tpl)
  return L_Config:provider(tpl.name)
end

function this:getStoryDes(tpl)
  return L_Config:provider(tpl.storyDes)
end

function this:getAbilityPara(tpl)
  return tpl.abilityPara
end

function this:getEchoVer(tpl)
  return tpl.echoVer
end

function this:getIcon(tpl)
  local icon = L_Config:getPathByHash(tpl.icon)
  return icon
end

function this:getTplByQuality(quality)
  local res = {}
  for i, v in pairs(self.data) do
    if quality == v.rarity then
      table.insert(res, v)
    end
  end
  table.sort(res, function(a, b)
    return a.id < b.id
  end)
  return res
end

return this
