class 'pearProduct' (regularProduct)

pearProduct.applianceName = ""

function pearProduct:__init(baseName) super(baseName)
end

function pearProduct:onClick()	
	
	-- overwrite regularProduct.onClick
	-- extend with appliance setSelected calls.
	-- call base class Product. and not regularProduct!
	if (self:isIngredient()) then
		if (self:isQueuableToTray()) then
			self:queue()
			getAppliance(self.applianceName):setSelected(true)	
			Product.onClick(self)
		
		end
		
	else
		if (self:isQueuableToTray()) then
			self:queue()
		
		end
		
		getAppliance(self.applianceName):setSelected(true)	
		Product.onClick(self)
		
	end	
		
end

function pearProduct:onWorkStart(task)

	if (regularProduct.onWorkStart(self, task)) then
		return true	
	end
	
	getAppliance(self.applianceName):setSelected(false)
	return false
	
end

function pearProduct:onWorkComplete(task)
	regularProduct.onWorkComplete(self, task)
	getAppliance(self.applianceName):setSelected(false)
end

