local PlayerRecordCell = class("PlayerRecordCell", BaseCell)

-- info = {name level avatar avatar_frame array_heroes}
function PlayerRecordCell:refresh(info)
    local uiMap = self:getUIMap()
    if not self.playerHeadCell then
        self.playerHeadCell = CellManager:addCellComp(uiMap["player_record_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
    end

    self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
    uiMap["player_record_cell.tx_name"]:setText(GFunc.formatPlayerName(info.name))
    uiMap["player_record_cell.btn_formation.tx_formation"]:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_14))
    uiMap["player_record_cell.btn_formation"]:addClickListener(function()
        ModuleManager.TipsManager:showHeroFormation(uiMap["player_record_cell.btn_formation"], GFunc.formatPlayerFormationInfo(info))
    end)
end

function PlayerRecordCell:setVisible(visible)
    self:getBaseObject():setActive(visible)
end

return PlayerRecordCell