local AppearanceTemplateManager = BaseClass("AppearanceTemplateManager")
local AppearanceTemplate = require("DataCenter.HeroData.AppearanceTemplate")
local __init = function(self)
  self.templateDict = {}
end
local __delete = function(self)
end
local GetTemplate = function(self, id)
  if not id then
    return nil
  end
  id = tonumber(id)
  if table.containsKey(self.templateDict, id) then
    return self.templateDict[id]
  end
  local newAppearanceId = DataCenter.LWSaveGirlManager:GetJPAppearanceId(id)
  local lineData = LocalController:instance():getLine(LuaEntry.Player:GetABTestTableName(TableName.HeroAppearance), newAppearanceId)
  if lineData == nil then
    Logger.LogError("AppearanceTemplateManager GetTemplate lineData is nil id:" .. id)
    return nil
  end
  local template = AppearanceTemplate.New()
  template:InitData(lineData)
  self.templateDict[id] = template
  return template
end
AppearanceTemplateManager.__init = __init
AppearanceTemplateManager.__delete = __delete
AppearanceTemplateManager.GetTemplate = GetTemplate
return AppearanceTemplateManager
