local this = class("worldObjTpl")

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

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

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

function this:getSievingType(tpl)
  return tpl.sievingType
end

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

function this:getPath(tpl)
  return tpl.path
end

function this:getObjName(tpl)
  return tpl.objName
end

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

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

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

function this:getWorldDifficultyObjLevel(tpl)
  if math.isEmpty(tpl.worldDifficultyObjLevel) then
    return nil
  end
  return tpl.worldDifficultyObjLevel
end

function this:getDefaultParam(tpl)
  return tpl.defaultParam
end

function this:getDefaultTrigger(tpl)
  return tpl.defaultTrigger
end

function this:getBattleObjType(tpl)
  return tpl.battleObjectType
end

function this:getWorldObjReborn(tpl)
  return tpl.worldObjReborn
end

function this:getLookOrder(tpl)
  return tpl.lookOrder
end

function this:getLookKind(tpl)
  return tpl.objKind or 0
end

function this:getFuncNpcType(tpl)
  return tpl.funcNpcType
end

function this:getFuncNpcTitle(tpl)
  return L_Config:provider(tpl.funcNpcTitle)
end

function this:getObjHeight(tpl)
  return tpl.objHeight
end

function this:getCollision(tpl)
  return tpl.collision ~= 1
end

function this:getBattleFieldItemId(tpl)
  local id = tpl.battleFieldItemId
  return id
end

function this:getDisappearTime(tpl)
  return tpl.disappearTime or 0
end

function this:getCanShowInMap(tpl)
  return tpl.icon ~= string.empty
end

function this:getTransferIcon()
  local first = self.data[1]
  return self:getIcon(first)
end

function this:getHudNameScale(tpl)
  if tpl.nameScale == nil or tpl.nameScale <= 0 then
    return 1
  end
  return tpl.nameScale
end

function this:getHudNameHide(tpl)
  return tpl.nameHiden == 1 and true or false
end

return this
