local BattleTaskCell = class("BattleTaskCell", BaseCell)

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

function BattleTaskCell:refresh(iconAtlas, iconName, taskNum, over)
    local uiMap = self:getUIMap()
    local bg = uiMap["battle_task_cell.bg"]
    local icon = uiMap["battle_task_cell.icon"]
    local point = uiMap["battle_task_cell.point"]
    local desc = uiMap["battle_task_cell.desc"]
    local check = uiMap["battle_task_cell.check"]
    icon:setSprite(iconAtlas, iconName)
    check:setVisible(over == true)
    desc:setText(taskNum)
    self:hidePoint(not taskNum)
end

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

function BattleTaskCell:addClickListener(func)
    self:getBaseObject():addClickListener(func)
end

return BattleTaskCell