event loop

This commit is contained in:
Jonas Zeunert
2020-03-11 21:56:54 +01:00
parent 625f57ec6f
commit 3bd278567a

View File

@@ -4,11 +4,16 @@ import config
from factories.NetworkFactory import NetworkFactory
from factories.GameFactory import GameFactory
import asyncio
async def main():
def main():
args = parseCommandLine()
game = createGame(args)
await game.run()
event_loop = asyncio.get_event_loop()
event_loop.run_until_complete(game.run())
event_loop.close()
def parseCommandLine():
parser = argparse.ArgumentParser(description='A game for the flippR')
@@ -17,9 +22,11 @@ def parseCommandLine():
return parser.parse_args()
def defaultOutputServerAddress():
return config.SOCKET_PATH + config.OUTPUT_SOCKET_NAME
def defaultInputServerAddress():
return config.SOCKET_PATH + config.INPUT_SOCKET_NAME