-- ----------------------------------------------------------------------------
goalGatherEnigmaPieces.mSteps = 
{
	{ action = "click", object = objectHoEnigmaHandle },
	{ action = "click", object = objectHoPaperroll },
	{ action = "click", object = objectHoButton2 },
}
-- ----------------------------------------------------------------------------
goalGatherEnigmaPieces.readyToStart = false
-- ----------------------------------------------------------------------------
function goalGatherEnigmaPieces:shouldStart()

	return self.readyToStart

end
-- ----------------------------------------------------------------------------
function goalGatherEnigmaPieces:onLayoutShow(layout)

	if (not self.readyToStart) then
		if (layout == layoutBoathouseEnigma) then
			if (objectBoathouseRedFlashingLight:isIdle()) then
				-- the red light is flashing
				-- we can start the goal
				self.readyToStart = true
			
			end	
		end
	end

end
-- ----------------------------------------------------------------------------
function goalGatherEnigmaPieces:onStarted()

	objectIoEnigmaHandleArea:ss(kActive)
	--objectIoEnigmaEmptyPaperrollHolder:ss(kActive)
	objectIoEnigmaButtonArea:ss(kActive)

	objectHoEnigmaHandle:ss(kActive)
	objectHoPaperroll:ss(kActive)
	objectHoButton2:ss(kActive)

end
-- ----------------------------------------------------------------------------
function goalGatherEnigmaPieces:onFinished()
end
-- ----------------------------------------------------------------------------
function goalGatherEnigmaPieces:onClickHO(layout, object, props, x, y)

	if (self:isStarted()) then
		local allFound = true
		
		allFound = allFound and objectHoEnigmaHandle:isFoundOrUsed()
		allFound = allFound and objectHoPaperroll:isFoundOrUsed()
		allFound = allFound and objectHoButton2:isFoundOrUsed()
		
		if (allFound) then
			self:achieved()
		end	
	end

end