from PodSix.Concurrent import Concurrent
from PodSix.Resource import *

class Screen(Concurrent, EventMonitor):
	def __init__(self, game):
		Concurrent.__init__(self)
		EventMonitor.__init__(self)
		self.game = game
		self.next = None
	
	def Pump(self):
		Concurrent.Pump(self)
		EventMonitor.Pump(self)
	
	def Quit(self):
		self.game.Quit()
	
	def GetResult(self):
		return self.next
	
	def SetResult(self, result):
		"""
		Result to pass back to the Game class:
		Either 'quit' or the name of the screen in game.screens to run next.
		"""
		self.next = result
	
	def GotFocus(self):
		"""
		Gets called when the Game class assigns this screen to be the currently active one.
		"""
		self.next = None


