Beispiel #1
0
	def POST(self):
		"""
		This function generates different html pages based on the buttons pressed by the user. From this screen, the player can choose to load a previous game or start a new one.

		Parameters:
		None

		Returns:
		None
		"""
		playerStateObject = PlayerState() #Update the player state
		action = web.input() #Create web.input() to save any information the user
		if action['new'] == 'storyScreen': #Checks to see if the user pressed the button to send them to the character selection screen
			raise web.seeother('/story') #If the above is true this line renders charScreen.html
		elif action['new'] == 'loadScreen': #Checks to see if the user pressed the button to load a previous game
			if None != DBManager.getPlayerCharacterActionFromDB(playerStateObject.player_id): #If the above is true this line checks to see if the player has chosen a character in their previous game
				if None != DBManager.getPlayerStoryActionFromDB(playerStateObject.player_id): #If the above is true this line checks to see if the player has chosen a story in their previous game
					raise web.seeother('/load') #If the above is true this line renders gameScreen.html
				else:
					raise web.seeother('/load') #If the conditional on line 65 is false then the story selection screen for the players chosen character is rendered
			else:
				raise web.seeother('/load') #If the conditional on line 64 is false then the character selection screen is rendered
		elif action['new'] == 'aboutScreen': #This conditional checks to see if the user pressed the button to go to the about screen
			raise web.seeother('/about') #If the above conditional is true this line renders aboutScreen.html
		elif action['new'] == 'helpScreen': #This conditional checks to see if the user pressed the button to go to the help screen
			raise web.seeother('/help') #If the above is true then helpScreen.html is rendered