--
-- this is a regular Product
-- it is useable for:
-- * simple products like CHIPS, COFFEE
-- * simple stock products 
-- * simple compound products like BUNBOTTOM, LETTUCE, 
-- * simple compound stock products like WAFFLE
--
-- it can be configured by
-- * setWorkTime
-- * setWorkAnimation
-- * setWorkSound
-- * setWorkSoundLooping
-- * setWorkOffsetX
-- * setWorkOffsetY
-- * setStock
-- * setMaxStock

class 'plateProduct' (Product)

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

function plateProduct:onClick()
	if (self:isSelected() == false) then
		cout("plateProduct:onClick()\n")
		self:setSelected(true)	
		Product.onClick(self)
	end
end

function plateProduct:onWorkStart(task)

    self:setSelected(false)  
    self:removeHighlight()
	self:setClickable(false)   
    Product.onWorkStart(self, task)		
    return true		
end

function plateProduct:onWorkComplete(task)
	Product.onWorkComplete(self, task)

	self:removeModifiers()
	self:setAlpha(1)
	emily:setAppearance("")
	
	if (tray:hasProduct("CARD")) then	
		tray:takeProduct("CARD")
		self:animate("OBJECT_CARD", 0)
		event:incCardsDone()
	end
end

