local this = class("homeLaborTypeTpl")

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

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

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

function this:getLaborDescList(tpl)
  local tmp = {}
  for _, v in ipairs(tpl.desc) do
    table.insert(tmp, L_Config:provider(v))
  end
  return tmp
end

function this:getLaborDescDetailList(tpl)
  local tmp = {}
  for _, v in ipairs(tpl.descDetail) do
    table.insert(tmp, L_Config:provider(v))
  end
  return tmp
end

function this:getLaborIcon(tpl)
  return tpl.icon
end

function this:getHomeBuffIdList(tpl)
  return tpl.homeBuffId
end

function this:getBuffValueParameter(tpl)
  return tpl.parameter
end

function this:getBuildingIconListByPetSize(tpl, petSize)
  local key = string.format("buildingIconPetSize%d", petSize)
  return tpl[key]
end

function this:getBuildingNameListByPetSize(tpl, petSize)
  local key = string.format("buildingNamePetSize%d", petSize)
  local tmp = {}
  for _, v in ipairs(tpl[key]) do
    table.insert(tmp, L_Config:provider(v))
  end
  return tmp
end

return this
