-- day class
class 'day0' (interface)

day0.mayor = nil

function day0:__init() super()
end

function day0:onLevelGlobals()

	autoStartGame = false
	autoAllPeopleWalkIn = false
	
	self.mayor = pm:createPerson("mayor")
	self.mayor:setPosition(entryNode)
	self.mayor:setVisible(false)
	self.mayor:setName("MAYOR")
	
	emily:setPosition(exitNode)
	emily:setVisible(false)
	cleaner:setPosition(exitNode)
	cleaner:setVisible(false)

	self.sequenceStart = 
	{
		{ "scene",			"qStartMovie" 											},
		{ "", 				"parallel"												},
		{ "emily",			"qSetVisible",				true						},
		{ "emily",			"qWalkToXY",				32, 18						},
		{ "cleaner",		"qWait",					300							},
		{ "cleaner",		"qSetVisible",				true						},
		{ "cleaner",		"qWalkToXY",				36, 18						},
		{ "", 				"sequential"											},
		{ "emily",			"qSetAppearance",			"LAUGH"						},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_0"		},
		{ "cleaner",		"qSetAppearance",			"THINKING"					},		
		{ "cleaner",		"qSay",						"RESTAURANT4_DAY0_1"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_2"		},
		{ "cleaner",		"qSay",						"RESTAURANT4_DAY0_3"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_4"		},
		{ "cleaner",		"qSetAppearance",			"ANGRY"						},
		{ "cleaner",		"qSay",						"RESTAURANT4_DAY0_5"		},
		{ "emily",			"qSetAppearance",			""							},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_6"		},
		{ "cleaner",		"qSetAppearance",			""							},
		{ "cleaner",		"qSay",						"RESTAURANT4_DAY0_7"		},
		{ "emily",			"qSetAppearance",			"SURPRISED"					},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_8"		},
		{ "cleaner",		"qSay",						"RESTAURANT4_DAY0_9"		},
		{ "emily",			"qSetAppearance",			""							},

		{ "mayor",			"qSetVisible",				true						},
		{ "mayor",			"qWalkToXY",				26, 20						},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_10"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_11"		},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_12"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_13"		},
		{ "mayor",			"qSetAppearance",			"SAD"						},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_14"		},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_15"		},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_16"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_17"		},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_18"		},
		{ "emily",			"qSetAppearance",			"LAUGH"						},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_19"		},
		{ "mayor",			"qSetAppearance",			"HAPPY"						},
		{ "mayor",			"qSay",						"RESTAURANT4_DAY0_20"		},
		{ "emily",			"qSay",						"RESTAURANT4_DAY0_21"		},
		{ "", 				"parallel"												},
		{ "mayor",			"qWalkToNode",				entryNode					},
		{ "mayor",			"qDestroy",					"day.mayor"					},
		{ "",				"parallel"												},
		{ "cleaner",		"qWalkToNode",				cleaner:getHomeNode()		},
		{ "emily",			"qWalkToNode",				grid:getCounterNode()		},
		{ "", 				"sequential"											},
		{ "emily",			"qSetAppearance",			""							},		
		{ "scene", 			"qFinishMovie" 											},
		{ "scene", 			"qStartGame" 											},		
	}
	
end

function day0:onLevelInited()

	qSequence(self.sequenceStart)

end

-- set day
day = day0()