first test
This commit is contained in:
19
__main__.py
19
__main__.py
@@ -1,16 +1,31 @@
|
||||
import argparse
|
||||
import config
|
||||
|
||||
from factories.NetworkFactory import NetworkFactory
|
||||
from factories.GameFactory import GameFactory
|
||||
|
||||
|
||||
def main():
|
||||
args = parseCommandLine()
|
||||
game = createGame(args)
|
||||
game.run()
|
||||
|
||||
def parseCommandLine():
|
||||
return
|
||||
parser = argparse.ArgumentParser(description='A game for the flippR')
|
||||
parser.add_argument('-o', '--OutputServerAddress', dest='OutputServerAddress', default=defaultOutputServerAddress())
|
||||
parser.add_argument('-i', '--InputServerAddress', dest='InputServerAddress', default=defaultInputServerAddress())
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
def defaultOutputServerAddress():
|
||||
return config.SOCKET_PATH + config.OUTPUT_SOCKET_NAME
|
||||
|
||||
def defaultInputServerAddress():
|
||||
return config.SOCKET_PATH + config.INPUT_SOCKET_NAME
|
||||
|
||||
def createGame(args):
|
||||
NetworkFactory.createNetwork(args['OutputServerAddress'], args['InputServerAddress'])
|
||||
print(args)
|
||||
NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
|
||||
gameFactory = GameFactory()
|
||||
game = gameFactory.createGame()
|
||||
return game
|
||||
|
||||
Reference in New Issue
Block a user