local SimpleHeroCell = class("SimpleHeroCell", BaseCell)

function SimpleHeroCell:refresh(heroEntity)
    local uiMap = self:getUIMap()
    local bg = uiMap["simple_hero_cell.bg"]
    local icon = uiMap["simple_hero_cell.icon"]
	local heroDec = uiMap["simple_hero_cell.dec"]
	local matchImg = uiMap["simple_hero_cell.match_img"]
	local lvTx = uiMap["simple_hero_cell.lv_tx"]
	local sImg = uiMap["simple_hero_cell.s"]
    local txName = uiMap["simple_hero_cell.tx_name"]

    local heroInfo = heroEntity:getConfig()
    bg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
	heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
	matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
	sImg:setVisible(heroInfo.qlt >= 4)
    lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, heroEntity:getLv()))
    txName:setText(heroEntity:getName())
    icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, DataManager.SkinData:getIcon(heroEntity:getSkinId()))

    self:getBaseObject():addClickListener(function()
        ModuleManager.HeroManager:showHeroDetailUI(nil, true, heroEntity)
    end)
end

return SimpleHeroCell