local this = class("petTpl")
local _mountTpl = L_GameTpl:getMountTpl()

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

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

function this:getSpeciesId(tpl)
  return tpl.speciesId
end

function this:getIsRename(tpl)
  return tpl.isRename
end

function this:getIsCatch(tpl)
  return tpl.IsCatch
end

function this:getCatchHP(tpl)
  return tpl.catchHP
end

function this:getSize(tpl)
  return tpl.size
end

function this:getGrowthAttribute(tpl)
  local growthAttribute = {}
  for i, v in pairs(tpl.growthAttribute) do
    growthAttribute[i] = v / 10000
  end
  return growthAttribute
end

function this:getPetIcon(tpl, isSpecial)
  local petIcon
  if not isSpecial or isSpecial == 0 then
    petIcon = L_Config:getPathByHash(tpl.petIcon)
  else
    petIcon = L_Config:getPathByHash(tpl.petIconSp[isSpecial])
  end
  if string.isEmpty(petIcon) then
    return "UI/Atlas/Item/tex_icon_pet_default.png"
  end
  return petIcon
end

function this:getPetPixelIcon(tpl, isSpecial)
  local petIcon
  if not isSpecial or isSpecial == 0 then
    petIcon = L_Config:getPathByHash(tpl.petPixelIcon)
  else
    petIcon = L_Config:getPathByHash(tpl.petPixelIconSp[isSpecial])
  end
  if string.isEmpty(petIcon) then
    return "UI/Atlas/Item/tex_icon_pet_default.png"
  end
  return petIcon
end

function this:getPetBattleIcon(tpl, index, isSpecial)
  local petIcon
  if not isSpecial or isSpecial == 0 then
    petIcon = L_Config:getPathByHash(tpl.petBattleIcon[index])
  else
    petIcon = L_Config:getPathByHash(tpl.petBattleIconSp[isSpecial][index])
  end
  if string.isEmpty(petIcon) then
    return "UI/Atlas/Item/tex_icon_pet_default.png"
  end
  return petIcon
end

function this:getKiboBoxCardIcon(tpl, index, isSpecial)
  local petIcon
  if not isSpecial or isSpecial == 0 then
    petIcon = L_Config:getPathByHash(tpl.kiboBoxCardIcon[index])
  else
    if tpl.kiboBoxCardIconSp[isSpecial] then
      petIcon = L_Config:getPathByHash(tpl.kiboBoxCardIconSp[isSpecial][index])
    end
    if string.isEmpty(petIcon) then
      petIcon = L_Config:getPathByHash(tpl.kiboBoxCardIcon[index])
    end
  end
  if string.isEmpty(petIcon) then
    return ""
  end
  return petIcon
end

function this:getPetLongIcon(tpl)
  local petIcon = L_Config:getPathByHash(tpl.petlongIcon)
  if string.isEmpty(petIcon) then
    return "UI/Atlas/Item/tex_icon_pet_default.png"
  end
  return petIcon
end

function this:getPetPuzzleIcon(tpl)
  local petIcon = L_Config:getPathByHash(tpl.petPuzzleIcon)
  if string.isEmpty(petIcon) then
    return "UI/Icon/BuffS/tex_battle_icon_guang.png"
  end
  return petIcon
end

function this:getGradeScore(tpl, isSpecial)
  if not isSpecial or isSpecial == 0 then
    return tpl.gradeScore
  end
  return tpl.gradeScoreSp[isSpecial] or 0
end

function this:getPuzzleType(tpl)
  return tpl.puzzleType
end

function this:getRace(tpl)
  return tpl.race
end

function this:getIsBattle(tpl)
  return tpl.isBattle
end

function this:getIsMount(tpl)
  return _mountTpl:isMount(tpl.id)
end

function this:getElement(tpl)
  return tpl.element
end

function this:getFirstElement(tpl)
  return tpl.element[1]
end

function this:getBaseAttribute(tpl)
  local baseAttribute = {}
  for i, v in pairs(tpl.baseAttribute) do
    baseAttribute[i] = v
  end
  return baseAttribute
end

function this:getName(tpl, isSpecial)
  if not isSpecial or isSpecial == 0 then
    return L_Config:provider(tpl.name)
  end
  return L_Config:provider(tpl.nameSp[isSpecial])
end

function this:getSkillGet(tpl)
  return tpl.skillGet
end

function this:getDesc(tpl)
  return L_Config:provider(tpl.desc)
end

function this:getUnitID(tpl)
  return tpl.unitId
end

function this:getUnitScale(tpl)
  return tpl.unitScale
end

function this:getUnitPosition(tpl)
  return tpl.unitPosition
end

function this:getUnitPositionGene(tpl)
  return tpl.unitPositionGene
end

function this:getUnitScaleGene(tpl)
  return tpl.unitScaleGene
end

function this:getUnitScaleGet(tpl)
  return tpl.unitScaleGet
end

function this:getUnitPositionGet(tpl)
  return tpl.unitPositionGet
end

function this:getUnitRotationGet(tpl)
  return tpl.unitRotationGet
end

function this:getUnitRotationType(tpl)
  return tpl.unitRotationType
end

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

function this:getFeature(tpl)
  return tpl.feature
end

function this:getEgg(tpl)
  return tpl.egg
end

function this:getPetStage(tpl)
  return tpl.petStage
end

function this:getRandomSkillList(tpl)
  return tpl.rPropertyskillList
end

function this:getFeatureSkillList(tpl)
  return tpl.fPropertyskillList
end

function this:getKiboFPropertySkillList(tpl)
  return tpl.kiboFPropertyskillList
end

function this:getKiboBPropertyskillList(tpl)
  return tpl.kiboBPropertyskillList
end

function this:getBPropertyskillList(tpl)
  return tpl.bPropertyskillList
end

function this:getSignatureSkillList(tpl)
  return tpl.signatureSkillList
end

function this:getCommonSkillList(tpl)
  return tpl.skillList
end

function this:getBreakSkillList(tpl)
  return tpl.breakSkillList
end

function this:getFixedSkillList(tpl)
  return tpl.fixedSkillList
end

function this:getPetPixelPosition(tpl, isSpecial)
  if not isSpecial or isSpecial == 0 then
    return tpl.petPixelPosition
  end
  return tpl.petPixelPositionSp[isSpecial]
end

function this:getPetBgGet(tpl)
  return tpl.bgGet
end

function this:getDna(tpl)
  return tpl.dna
end

function this:getKiboCardIcon(tpl, isSpecial)
  if not isSpecial or isSpecial == 0 then
    return tpl.kiboCardIcon
  end
  return tpl.kiboCardIconSp
end

function this:getPetTalkIcon(tpl, isSpecial)
  if not isSpecial or isSpecial == 0 then
    return tpl.petTalkIcon
  end
  return tpl.petTalkIconSp
end

function this:getBattleTag(tpl)
  return tpl.battleTag
end

function this:getKiboDuelTag(tpl)
  return tpl.kiboDuelTag
end

function this:getKiboSkillList(tpl)
  return tpl.kiboSkillList
end

function this:getIconographyMapPos(tpl)
  return tpl.iconographyMapPos or {}
end

return this
