local EquipListCell = class("EquipListCell", BaseCell)

function EquipListCell:init()
	local uiMap = self.baseObject:genAllChildren()
	self.equipCell = uiMap["cell.equip_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.EQUIP_CELL)
	self.nameTx = uiMap["cell.name_tx"]
	self.powerTx = uiMap["cell.power_tx"]
	self.wearBtn = uiMap["cell.wear_btn"]
	self.wearBtnTx = uiMap["cell.wear_btn.text"]
	self.wearBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_30))

	self.wearBtn:addClickListener(function()
		-- if DataManager.DailyTaskData:canClaimTask(self.taskId) then
		--     ModuleManager.TaskManager:claimDailyTask(self.taskId)
		-- else
		--     ModuleManager.TaskManager:taskGoto(self.taskType)
		-- end
	end)
end

function EquipListCell:refresh(entity, slotId)
	self.entity = entity
	self.slotId = slotId
	self.nameTx:setText(entity:getName())
	self.powerTx:setText(entity:getPower())
	self.equipCell:refresh(entity, slotId)
end

return EquipListCell