goalFixEnigma.mSteps = 
{
	{ action = "click", object = objectIoStillwaterPaperWrong },
	{ action = "click", object = objectIoStillwaterPaperWrongClose },
	{ action = "click", object = objectIoEnigmaHandleArea, selection = objectHoEnigmaHandle },	
	{ action = "click", object = objectIoEnigmaEmptyPaperrollHolder, selection = objectHoPaperroll },
	{ action = "click", object = objectIoEnigmaButtonArea, selection = objectHoButton2 },
	{ action = "click", object = objectEnigmaButton1 },
	{ action = "click", object = objectEnigmaButton2 },
}
-- ----------------------------------------------------------------------------
goalFixEnigma.readyToStart = false
goalFixEnigma.readPaper = false
-- ----------------------------------------------------------------------------
function goalFixEnigma:shouldStart()

	return self.readyToStart

end
-- ----------------------------------------------------------------------------
function goalFixEnigma:onStarted()
end
-- ----------------------------------------------------------------------------
function goalFixEnigma:onFinished()
end
-- ----------------------------------------------------------------------------
function goalFixEnigma:onLayoutHide(layout)

	if (not self.readPaper) then
		if (layout == layoutBoathouseEnigma) then
			if (objectIoStillwaterPaperWrongClose:isInactive()) then
				print("(goalFixEnigma) manually set step 2 to done!")
				self.mSteps[2].done = true
				self.readPaper = true
			end
		end
	end

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

	if (not self.readyToStart) then
		local allFound = true
		
		allFound = allFound and objectHoEnigmaHandle:isFoundOrUsed()
		allFound = allFound and objectHoPaperroll:isFoundOrUsed()
		allFound = allFound and objectHoButton2:isFoundOrUsed()
		
		if (allFound) then
			self.readyToStart = true
		end	
	end

end
-- ----------------------------------------------------------------------------
function goalFixEnigma:onClickButton(layout, object, props, x, y)

	self:checkAchieved()

end
-- ----------------------------------------------------------------------------
function goalFixEnigma:onUsedAll(object, props)

	self:checkAchieved()

end

-- ----------------------------------------------------------------------------
function goalFixEnigma:checkAchieved()

	if (self:isStarted()) then
		local allUsed = true
		
		allUsed = allUsed and objectHoEnigmaHandle:isUsed()
		allUsed = allUsed and objectHoPaperroll:isUsed()
		allUsed = allUsed and objectHoButton2:isUsed()
		allUsed = allUsed and objectEnigmaButton1:isIdle()
		allUsed = allUsed and objectEnigmaButton2:isIdle()
		
		if (allUsed) then
			self:achieved()
		end	
	end

end