-- ----------------------------------------------------------------------------
goalNamesMap = 
{
	{ "goalReadNote", 			"GOAL_01" },
	{ "goalFindKey", 			"GOAL_02" },
	{ "goalOpenCabin", 			"GOAL_03" },
	{ "goalOpenShutters", 		"GOAL_04" },
	{ "goalFindPapers", 		"GOAL_05" },
	{ "goalGatherShutterParts", "GOAL_06" },
	{ "goalInvestigateSuitcase","GOAL_54" },
	{ "goalFillSuitcase", 		"GOAL_07" },
	{ "goalEnterCabin", 		"GOAL_08" },
	{ "goalFixElectricity", 	"GOAL_09" },
	{ "goalFindFuses", 			"GOAL_10" },
	{ "goalPlaceFuses", 		"GOAL_11" },
	{ "goalInvestigateNoise", 	"GOAL_12" },
	{ "goalGatherRadioParts", 	"GOAL_13" },
	{ "goalFixRadio", 			"GOAL_14" },
	{ "goalFindPhone", 			"GOAL_15" },
	{ "goalGatherPhoneParts", 	"GOAL_16" },
	{ "goalFixPhone",		 	"GOAL_17" },
	{ "goalLocatePhonebook", 	"GOAL_18" },
	{ "goalFindPoliceNumber", 	"GOAL_19" },
	{ "goalCallPolice",		 	"GOAL_20" },
	
	{ "goalInvestigateInterior","GOAL_53" },
	{ "goalFindMirrorPieces",	"GOAL_21" },
	{ "goalFixMirror",		 	"GOAL_22" },
	
	{ "goalFindFirepit",	 	"GOAL_23" },
	{ "goalGatherWood",		 	"GOAL_24" },
	{ "goalPlaceWood",		 	"GOAL_25" },
	{ "goalFindLighter",	 	"GOAL_26" },
	{ "goalLightFire",		 	"GOAL_27" },
	{ "goalInvestigateDamage",	"GOAL_28" },
	{ "goalGatherCarMaterial",	"GOAL_29" },
	{ "goalOpenTrunk",	 		"GOAL_51" },
	{ "goalFindChisel",	 		"GOAL_30" },
	{ "goalChangeTire",		 	"GOAL_31" },
	{ "goalCreateSurface",	 	"GOAL_32" },
	{ "goalCheckFrontCar",	 	"GOAL_33" },	-- Optional goal
	{ "goalFindRag",		 	"GOAL_34" },
	{ "goalUseRag",		 		"GOAL_48" },
	{ "goalFindWater",		 	"GOAL_47" },
	{ "goalUseWater",		 	"GOAL_35" },
	{ "goalCheckTire",		 	"GOAL_50" },
	{ "goalFindCarWires",	 	"GOAL_36" },
	{ "goalFollowPerson",		"GOAL_37" },
	{ "goalGatherEnigmaPieces",	"GOAL_55" },
	{ "goalFixEnigma",			"GOAL_56" },
	{ "goalInvestigateTornCard","GOAL_57" },
	{ "goalGatherCardPieces",	"GOAL_58" },
	{ "goalCreateCard1",		"GOAL_59" },
	{ "goalCreateCard2",		"GOAL_60" },
	{ "goalUseCard2",			"GOAL_61" },
	{ "goalCheckRosebush",		"GOAL_65" },
	{ "goalFigureOut",			"GOAL_38" },
	{ "goalGatherHitchPieces",	"GOAL_62" },
	{ "goalFixHitchhiker",		"GOAL_63" },
	{ "goalGatherStonePieces",	"GOAL_39" },
	{ "goalFixHookman",			"GOAL_49" },
	{ "goalFindMissingPiece",	"GOAL_40" },
	{ "goalFixRotascope",		"GOAL_64" },
	{ "goalGatherFilesSamples",	"GOAL_41" },
	{ "goalDestroyFilesSamples","GOAL_42" },
	{ "goalFindSharpCutter",	"GOAL_43" },
	{ "goalGrabWire",			"GOAL_44" },
	{ "goalCheckDoor",			"GOAL_52" },
	{ "goalBlockHookman",		"GOAL_45" },
	{ "goalGetAway",		 	"GOAL_46" },
}
goalMap = {}
-- ----------------------------------------------------------------------------
constructGoalVariables()
-- ----------------------------------------------------------------------------
goalStack.graph =
{
	{ 
		goals = { goalReadNote, }, 
		load = { layoutPorch, layoutPorchNote, layoutPorchRock, layoutPorchDoorknob, layoutLivingroom, layoutPorchWindow, 
				 layoutPorchWindowMechdetail, layoutShedShutterManual, layoutShed, layoutShedCabinet, layoutShedLawnmower, 
				 layoutShedToolbox, layoutBasement, layoutBasementFusebox, layoutBasementSecretDoor },
				 
	},
	{
		goals = { goalFindKey, },
	},
	{
		goals = { goalOpenCabin, },
	},
	{
		goals = { goalOpenShutters, goalFindPapers, goalGatherShutterParts },
		unload = { layoutPorchDoorknob, layoutPorchNote },
	},
	{
		goals = { goalEnterCabin, },
	},
	{
		goals = { goalFixElectricity, },
		unload = { layoutPorchWindow, layoutPorchWindowMechdetail },
	},
	{
		goals = { goalFindFuses, goalInvestigateSuitcase, goalFillSuitcase },
		load = { layoutPorchSuitcase },		
	},
	{
		goals = { goalPlaceFuses, },
		load = { layoutBedroom, layoutBedroomPhoneNumbers, layoutBedroomRadio, layoutLivingroomPaper, layoutLivingroomPhone, 
				 layoutLivingroomPicture, layoutLivingroomRadioStations, layoutLivingroomTelevision, layoutBasementPaper,
				 layoutBasementCorner },
		unload = { layoutPorchSuitcase },
	},
	{
		goals = { goalInvestigateNoise, },
	},
	{
		goals = { goalGatherRadioParts, },
		load = { layoutLivingroomCupboard },		
	},
	{
		goals = { goalFixRadio, },
	},
	{
		goals = { goalFindPhone, },
	},
	{
		goals = { goalGatherPhoneParts, },
	},
	{
		goals = { goalFixPhone, },
	},
	{
		goals = { goalLocatePhonebook, },
	},
	{
		goals = { goalFindPoliceNumber, },
	},
	{
		goals = { goalCallPolice, },
		load = { layoutCar, layoutCarMirror, layoutCarPaperwork },
	},
	{
		goals = { goalInvestigateInterior, },
		unload = { layoutPorch, layoutPorchRock, layoutPorchNote, layoutPorchDoorknob, layoutLivingroom, layoutLivingroomPaper, layoutPorchWindow, 
				 layoutPorchWindowMechdetail, layoutShedShutterManual, layoutPorchSuitcase, layoutShed, layoutShedCabinet, layoutShedLawnmower, 
				 layoutShedToolbox, layoutLivingroomCupboard, layoutLivingroomPhone, layoutLivingroomPicture, layoutLivingroomRadioStations,
				 layoutLivingroomTelevision, layoutBasement, layoutBasementCorner, layoutBasementFusebox, layoutBasementPaper, 
				 layoutBasementSecretDoor, layoutBedroom, layoutBedroomPhoneNumbers, layoutBedroomRadio },		
	},
	{
		goals = { goalFindMirrorPieces, },
	},
	{
		goals = { goalFixMirror, },
		load = { layoutCar2, layoutCar2Glovebox, layoutLakeside, layoutLakesideBoathouseDoor, layoutLakesideCampfire, layoutLakesideWater,
				 layoutWoods1, layoutWoods1Battery, layoutWoods1Engine, layoutWoods1Kiosk, layoutWoods1Tirechange, layoutWoods1Trunk, 
				 layoutWoods1Trunkfloor, layoutWoods2, layoutWoods2BobcatCave, layoutWoods2Sticks, layoutBoathouse, layoutBoathouseLock,
				 layoutBoathouseMap, layoutBoathouseRotascope, layoutBoathouseCardMachine },
	},
	{
		goals = { goalFindFirepit, },
		load = { layoutCar, layoutCarMirror, layoutCarPaperwork },
	},
	{
		goals = { goalGatherWood, },
	},
	{
		goals = { goalPlaceWood, },
	},
	{
		goals = { goalFindLighter, },
	},
	{
		goals = { goalLightFire, },
	},
	{
		goals = { 	goalFindCarWires, goalInvestigateDamage,
					goalGatherCarMaterial, goalOpenTrunk, goalFindChisel, goalChangeTire, 
					goalCreateSurface, goalCheckFrontCar, goalFindRag, goalUseRag, goalFindWater, 
					goalUseWater, goalCheckTire, goalFollowPerson, goalGatherEnigmaPieces, goalFixEnigma,
					goalInvestigateTornCard, goalGatherCardPieces, goalCreateCard1, goalCreateCard2, goalUseCard2, goalCheckRosebush,
					goalFigureOut, goalGatherHitchPieces, goalFixHitchhiker, goalGatherStonePieces, goalFixHookman, goalFindMissingPiece, 
					goalFixRotascope, goalGatherFilesSamples, goalDestroyFilesSamples, goalFindSharpCutter, goalGrabWire
				},
		load = { layoutCemetery, layoutCemeteryFence, layoutCrypt, layoutCryptKeypad,
				 layoutCryptHitchhiker, layoutCryptHookman, layoutCryptMedfile, layoutCryptRotascope, layoutCryptSecretDoor, 
				 layoutCryptSecretDoorInside, layoutCryptShrine, layoutCryptStove, layoutCemeteryFencePaper, layoutBoathouseEnigma,
				 layoutBoathouseCardJigsaw },
		unload = { layoutLakesideCampfire },
	},
	{
		goals = { goalCheckDoor, },
		unload = { layoutBoathouseLock, layoutBoathouseCardJigsaw, layoutWoods1Tirechange },
	},
	{
		goals = { goalBlockHookman, },
	},
	{
		goals = { goalGetAway, },
	},
}
