local HeroRankTemplateManager = BaseClass("HeroRankTemplateManager")
local HeorRankTemplate = require("DataCenter.HeroData.HeroRankTemplate")
local Localization = CS.GameEntry.Localization
local __init = function(self)
  self.templateDict = {}
end
local __delete = function(self)
  self.templateDict = nil
end
local GetTemplate = function(self, id)
  if id == nil then
    return nil
  end
  local data = self.templateDict[id]
  if data == nil then
    data = HeorRankTemplate.New()
    data:InitData(LocalController:instance():getLine(TableName.LW_Hero_Rank, id))
    self.templateDict[id] = data
  end
  return data
end
local GetRankName = function(self, rankId)
  local rankTemplate = self:GetTemplate(rankId)
  if rankTemplate == nil then
    return ""
  end
  return Localization:GetString(rankTemplate.name)
end
local GetRankSmallIcon = function(self, rankId)
  local rankTemplate = self:GetTemplate(rankId)
  if rankTemplate == nil then
    return ""
  end
  return rankTemplate.small_icon
end
HeroRankTemplateManager.__init = __init
HeroRankTemplateManager.__delete = __delete
HeroRankTemplateManager.GetTemplate = GetTemplate
HeroRankTemplateManager.GetRankName = GetRankName
HeroRankTemplateManager.GetRankSmallIcon = GetRankSmallIcon
return HeroRankTemplateManager
