layoutBoathouse.mExits =
{
	[objectExitBoathouseLakeside] = 
	{
		target = layoutLakeside,
		arrowX = 289,
		arrowY = 343,
		arrowAngle = 1.5 * math.pi,
		labelX = 182,
		labelY = 290,
		labelAnchorpoint = ANCHOR_CENTER_LEFT,
	},
}
layoutBoathouse.mPOIs = 
{
	[objectPoiRotascopeBoathouseClosed] = 
	{
		target = layoutBoathouseRotascope,
		mirrors = {objectPoiRotascopeBoathouseOpen}
	},
	[objectPoiSecretMap] = 
	{
		target = layoutBoathouseMap,
	},
	[objectPoiCardMachine] = 
	{
		target = layoutBoathouseCardMachine,
	},
	[objectPoiEnigma] = 
	{
		target = layoutBoathouseEnigma,
	},	
}
layoutBoathouse.mIOs =
{
}
layoutBoathouse.mHOs = 
{
	[objectHoEnigmaHandle] =
	{
		siblings = {objectHoEnigmaHandleDark, objectHoEnigmaHandlePocket},
	},
	[objectHoPaperroll] =
	{
		siblings = {objectHoPaperrollDark, objectHoPaperrollPocket},
	},	
	[objectHoCardPiece04] = 
	{
		siblings = {objectHoCardPiece04Lit},
	},
	[objectHoCardPiece05] = 
	{
		siblings = {objectHoCardPiece05Lit, objectHoCardPiece05Pocket},
	},
	[objectHoCardPiece06] = 
	{
		siblings = {objectHoCardPiece06Lit},
	},
	[objectHoCardPiece07] = 
	{
		siblings = {objectHoCardPiece07Lit},
	},
	[objectHoCardPiece08] = 
	{
		siblings = {objectHoCardPiece08Lit, objectHoCardPiece08Pocket},
	},
	[objectHoCardPiece09] = 
	{
		siblings = {objectHoCardPiece09Lit},
	},					
}
layoutBoathouse.mEffectMosquitosBack = nil
layoutBoathouse.mEffectMosquitosFront = nil
layoutBoathouse.mPlayerKnowsHiddenPassage = false
-- ----------------------------------------------------------------------------
function layoutBoathouse:onConstruct()
	
	Layout.onConstruct(self)
	
	self.mEffectMosquitosBack = self:newChildParticle( { name = "PARTICLE_BOATHOUSE_BACK_MOSQUITOS", x=296, y=331, library="PARTICLE_LAMP_MOSQUITOS", section="particles", play=true, removeWhenFinished=false } )
	self.mEffectMosquitosFront = self:newChildParticle( { name = "PARTICLE_BOATHOUSEDOOR_FRONT_MOSQUITOS", x=336, y=649, library="PARTICLE_LAMP_MOSQUITOS", section="particles", play=true, removeWhenFinished=false } )

	objectPoiCardMachine:ss(kActive)
	objectPoiEnigma:ss(kLocked)
	
	objectBoathouseRedFlashingLight:ss(kInactive)
	objectBoathouseStillwaterPaper:ss(kInactive)
	objectGreenLightButton1Small:ss(kInactive)
	objectGreenLightButton2Small:ss(kInactive)
	objectEnigmaButton2Small:ss(kInactive)
	objectSliderPaperrollSmall:ss(kInactive)
	objectEnigmaHandleSmall:ss(kInactive)
	objectFilledPaperrollHolderSmall:ss(kInactive)
	objectCardMachineGreenLight:setAlpha(0)
	objectCardMachineRedLight:setAlpha(1)	
	
end
-- ----------------------------------------------------------------------------
function layoutBoathouse:onInitialize()

	Layout.onInitialize(self)
	
	objectExitBoathouseLakeside:ss(kActive)
	objectPoiRotascopeBoathouseClosed:ss(kActive)
	objectPoiRotascopeBoathouseOpen:ss(kInactive)
	objectPoiSecretMap:ss(kActive)
	
end
-- ----------------------------------------------------------------------------
function layoutBoathouse:onAnimationFinish(animationName)

	Layout.onAnimationFinish(self, animationName)
	
	if (animationName == "FlashingEnigmaLight") then
		self:animRedLight()
	end

end
-- ----------------------------------------------------------------------------
function layoutBoathouse:onStartAudio()

	-- Play some outside noises
	playAmbientAudio(kInsideHutAmbientGroup)
	
	-- Sweeteners
	local waterTrack = {}
	
	waterTrack.group = kOutsideHutAmbientGroup
	waterTrack.tag = "BOAT_WATER"
	waterTrack.definition = "WATER_ON_BOAT"
	waterTrack.volume = 0.8
	
	getAudioManager():playTrack(waterTrack)

end
-- ----------------------------------------------------------------------------
function layoutBoathouse:onStopAudio()
	stopAudioTrack("BOAT_WATER")
end
-- ----------------------------------------------------------------------------
function layoutBoathouse:animRedLight()

	if (objectBoathouseRedFlashingLight:isIdle()) then
		objectBoathouseRedFlashingLight:animate("FlashingEnigmaLight",
			{ alpha=1,	duration=100	},
			{ delay=500					},
			{ alpha=0,	duration=100	},
			{ delay=1000				}
		)
	end

end
-- ----------------------------------------------------------------------------
function layoutBoathouse:onTick(time)

	Layout.onTick(self, time)
	
	objectCardMachineGreenLight:setAlpha(objectGreenLightOn:alpha())
	objectCardMachineRedLight:setAlpha(objectRedLightOn:alpha())

end
