Browse Source

balance_util is created and used to create the BalanceTtrsPlayer

feature/balanceutils
informaniac 7 years ago
parent
commit
81de8409f2
  1. 4
      games/ttrs.py

4
games/ttrs.py

@ -475,11 +475,11 @@ if __name__ == '__main__':
def start_game(player_id, xpos): def start_game(player_id, xpos):
pg = Playground(10, 16) pg = Playground(10, 16)
balance_util = blup.balance_util.BalanceUtil(sock, player_id)
if args.pygame: if args.pygame:
player = TestTtrsPlayer(pg) player = TestTtrsPlayer(pg)
elif args.balance is not None: elif args.balance is not None:
host, port = args.balance.split(':') player = BalanceTtrsPlayer(pg, balance_util)
player = BalanceTtrsPlayer(pg, (host, int(port)), player_id)
rnd = random.Random(seed) rnd = random.Random(seed)
game = TtrsGame(pg, player, rnd) game = TtrsGame(pg, player, rnd)
painter.add_game(game, xpos, 0) painter.add_game(game, xpos, 0)

Loading…
Cancel
Save