layoutWoods1Engine.mExits =
{
}

layoutWoods1Engine.mPOIs = 
{
	[objectPoiBattery] = 
	{
		target = layoutWoods1Battery,
	},
}

layoutWoods1Engine.mHOs = 
{
	[objectHoRadiatorCap] = 
	{
	},
}

layoutWoods1Engine.mIOs =
{
	[objectIoRadiatorCap] = 
	{
		links = {objectHoRag},
	},
	[objectIoRadiatorOpen] = 
	{
		links = {objectHoTinCanFilled},
	}
}
layoutWoods1Engine.mEffectRadiatorSmoke = nil
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onConstruct()
	
	Layout.onConstruct(self)
	
	objectBatterySparks:ss(kInactive)
	self.mEffectRadiatorSmoke = self:newChildParticle( { name = "PARTICLE_RADIATOR_SMOKE_POI", x=81, y=220, library="PARTICLE_WOODS1_CAR_ENGINE_SMOKE_POI", section="particles", play=false, removeWhenFinished=false } )
	
end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onInitialize()

	Layout.onInitialize(self)
	
	objectPoiBattery:ss(kActive)
	objectBatteryFixed:ss(kInactive)
	objectRadiatorCapFilledWater:ss(kInactive)
	objectRadiatorFilledWater:ss(kInactive)
	objectIoRadiatorOpen:ss(kInactive)
	objectHoRadiatorCap:ss(kInactive)
	objectIoRadiatorCap:ss(kActive)

end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onUsedAll(object, props)
	
	if (object == objectIoRadiatorOpen) then
		objectRadiatorFilledWater:setAlpha(0)
		objectRadiatorFilledWater:ss(kIdle)
		objectRadiatorFilledWater:animate("FillWater_blocking",
			{ alpha=0							 },
			{ alpha=1,		duration=kTimeFadeSwitch },
			{ delay=kTimeDelay					}
		)
	end
	
	if (object == objectIoRadiatorCap) then
		objectIoRadiatorCap:ss(kDone)
		objectHoRadiatorCap:ss(kIdle)

	end

	return Layout.onUsedAll(self, object, props)

end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onAnimationFinish(animationName)

	if (animationName == "FillWater_blocking") then
		objectRadiatorCapFilledWater:setAlpha(0)
		objectRadiatorCapFilledWater:ss(kIdle)
		objectRadiatorCapFilledWater:animate("PlaceCap_blocking",
			{ alpha=0							 },
			{ alpha=1,		duration=kTimeFadeSwitch },
			{ delay=kTimeDelay					}
		)
		objectRadiatorFilledWater:animate(
			{ alpha=1							 },
			{ alpha=0,		duration=kTimeFadeSwitch }
		)
		objectHoRadiatorCap:ss(kDone)
		
	elseif (animationName == "PlaceCap_blocking") then
		objectRadiatorFilledWater:ss(kDone)
		
	elseif (animationName == "batteryShine") then
		self:showBatteryHighlight()
		
	end
	
	Layout.onAnimationFinish(self, animationName)

end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onHide()

	Layout.onHide(self)
	
	layoutWoods1:checkShadowScare()
	
end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:onClickIO(object, x, y)
	
	if (object == objectIoRadiatorOpen and gSelection == objectHoCan) then
		think("MESSAGE_FILL_CAN_FIRST")
	end
	
	return Layout.onClickIO(self, object, x, y)
	
end
-- ----------------------------------------------------------------------------
function layoutWoods1Engine:showBatteryHighlight()

	if (objectBatterySparks:isIdle()) then
		objectBatterySparks:animate("batteryShine",
			{ delay = math.random(2000, 7000) },
			{ startframe=0, endframe=8, frametime=50 }
		)		
	end

end