class GameServer(IFGPServInd): def __init__(self): logging.debug("GameServer") self.state = WF_P1() self.fgpserver = FGPServer(self, host, port) while True: self.fgpserver.listen() def getState(self): return self.state def setState(self, state): logging.debug(self.state.name() + " --> " + state.name()) self.state = state def getFGPServer(self): return self.fgpserver # Delegating incoming events to the states. # Interface IFGPServInd def play(self): self.state.play(self)
def __init__(self): logging.debug("GameServer") self.state = WF_P1() self.fgpserver = FGPServer(self, host, port) while True: self.fgpserver.listen()