change singleton to global
This commit is contained in:
@@ -7,6 +7,8 @@ from factories.GameFactory import GameFactory
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
networking = None
|
||||
|
||||
def main():
|
||||
args = parseCommandLine()
|
||||
logging.basicConfig(filename='log.txt', level=logging.INFO)
|
||||
@@ -29,11 +31,12 @@ def defaultOutputServerAddress():
|
||||
def defaultInputServerAddress():
|
||||
return config.SOCKET_PATH + config.INPUT_SOCKET_NAME
|
||||
|
||||
|
||||
def createGame(args):
|
||||
print(args)
|
||||
NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
|
||||
gameFactory = GameFactory()
|
||||
game = gameFactory.createGame()
|
||||
global networking
|
||||
networking = NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
|
||||
game = GameFactory().createGame()
|
||||
return game
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user