local TopRankCell = class("TopRankCell", BaseCell)

function TopRankCell:refresh(info)
    local uiMap = self:getUIMap()
    if not self.playerHeadCell then
        self.playerHeadCell = CellManager:addCellComp(uiMap["top_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
    end

    local txName = uiMap["top_rank_cell.name"]
    local txWin = uiMap["top_rank_cell.win"]
    local txWinDesc = uiMap["top_rank_cell.win_desc"]
    txWinDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_17))

    if info then
        txName:setText(info.name)
        txWin:setText(info.total_win)
        self.playerHeadCell:getBaseObject():addClickListener(function()
            -- ModuleManager.ActBossRushManager:reqOtherPlayerInfo(info.id, function(formation)
            --     if not self.playerHeadCell or not self.playerHeadCell:getBaseObject() or self.playerHeadCell:getBaseObject():isDestroyed() then
            --         return
            --     end
            --     ModuleManager.TipsManager:showHeroFormation(self.playerHeadCell:getBaseObject(), formation)
            -- end)
        end)
        self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
    else
        txName:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_8))
        txWin:setText("--")
        self.playerHeadCell:getBaseObject():addClickListener(nil)
        self.playerHeadCell:refresh(3001, 1000, false) -- 默认
    end
end

return TopRankCell