local RuneTaskCell = class("RuneTaskCell", BaseCell)

local BG = {"common_board_131", "common_board_132"} -- 紫绿

function RuneTaskCell:refresh(taskInfo)
    local uiMap = self:getUIMap()
    local bg = uiMap["rune_task_cell.bg"]
    local icon = uiMap["rune_task_cell.icon"]
    local point = uiMap["rune_task_cell.point"]
    local desc = uiMap["rune_task_cell.desc"]
    local taskType = taskInfo[1]
    local taskParams1 = taskInfo[2]
    local taskParams2 = taskInfo[3]

    local taskNum = 0
    if taskType == GConst.DungeonRuneConst.TASK_TYPE.PASS_ROUND then
        taskNum = taskParams1
    else
        taskNum = taskParams2 or 0
    end

    local runeData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.RUNES_OPEN)
    icon:setSprite(runeData:getConditionIcon(taskInfo))

    desc:setText(taskNum)

    self:hidePoint(false)
end

function RuneTaskCell:hidePoint(hide)
    local uiMap = self:getUIMap()
    local point = uiMap["rune_task_cell.point"]
    local desc = uiMap["rune_task_cell.desc"]
    point:setVisible(not hide)
    desc:setVisible(not hide)
end

return RuneTaskCell