local BossSkillCell = class("BossSkillCell", BaseCell)

function BossSkillCell:init()
	self.baseObject:addClickListener(function()
		ModuleManager.TipsManager:showBattleSkillTips(self.baseObject, nil, self.skillId)
	end)
	local uiMap = self:getUIMap()
	self.icon = uiMap["boss_skill_cell.icon"]
	self.roundTx = uiMap["boss_skill_cell.round_text"]
	self.mask = uiMap["boss_skill_cell.mask"]
end

function BossSkillCell:refresh(skillEntity)
	local skillId = skillEntity:getSkillId()
	local cd = skillEntity:getShowCd()
	local coolCd = skillEntity:getShowCoolingRounds()
	self.skillId = skillId
	local icon = ModuleManager.HeroManager:getSkillIcon(skillId)
	self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, icon)
	self.roundTx:setText(cd + 1)

	self.mask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE).fillAmount = (cd + 1) / coolCd
end

function BossSkillCell:setActive(active)
	self.baseObject:setActive(active)
end

return BossSkillCell