Exemplo n.º 1
0
 def __init__(self, tc, player_b=None, player_w=None, **kwargs):
     self.tc = tc
     kwargs.setdefault('board_size', 9)
     game_controller = gtp_controller.Game_controller('one', 'two')
     if player_b is None:
         player_b = gtp_engine_fixtures.Test_player()
     if player_w is None:
         player_w = gtp_engine_fixtures.Test_player()
     engine_b = gtp_engine_fixtures.make_player_engine(player_b)
     engine_w = gtp_engine_fixtures.make_player_engine(player_w)
     channel_b = gtp_controller_test_support.Testing_gtp_channel(engine_b)
     channel_w = gtp_controller_test_support.Testing_gtp_channel(engine_w)
     controller_b = gtp_controller.Gtp_controller(channel_b, 'player one')
     controller_w = gtp_controller.Gtp_controller(channel_w, 'player two')
     game_controller.set_player_controller('b', controller_b)
     game_controller.set_player_controller('w', controller_w)
     game = gtp_games.Gtp_game(game_controller, **kwargs)
     self.game_controller = game_controller
     self.game = game
     self.controller_b = controller_b
     self.controller_w = controller_w
     self.channel_b = channel_b
     self.channel_w = channel_w
     self.engine_b = channel_b.engine
     self.engine_w = channel_w.engine
     self.player_b = channel_b.engine.player
     self.player_w = channel_w.engine.player
Exemplo n.º 2
0
 def __init__(self, tc, player_b=None, player_w=None, **kwargs):
     self.tc = tc
     kwargs.setdefault('board_size', 9)
     game_controller = gtp_controller.Game_controller('one', 'two')
     if player_b is None:
         player_b = gtp_engine_fixtures.Test_player()
     if player_w is None:
         player_w = gtp_engine_fixtures.Test_player()
     engine_b = gtp_engine_fixtures.make_player_engine(player_b)
     engine_w = gtp_engine_fixtures.make_player_engine(player_w)
     channel_b = gtp_controller_test_support.Testing_gtp_channel(engine_b)
     channel_w = gtp_controller_test_support.Testing_gtp_channel(engine_w)
     controller_b = gtp_controller.Gtp_controller(channel_b, 'player one')
     controller_w = gtp_controller.Gtp_controller(channel_w, 'player two')
     game_controller.set_player_controller('b', controller_b)
     game_controller.set_player_controller('w', controller_w)
     game = gtp_games.Gtp_game(game_controller, **kwargs)
     self.game_controller = game_controller
     self.game = game
     self.controller_b = controller_b
     self.controller_w = controller_w
     self.channel_b = channel_b
     self.channel_w = channel_w
     self.engine_b = channel_b.engine
     self.engine_w = channel_w.engine
     self.player_b = channel_b.engine.player
     self.player_w = channel_w.engine.player
Exemplo n.º 3
0
 def __init__(self, tc, player_b=None, player_w=None,
              komi=0.0, board_size=9):
     self.tc = tc
     game = gtp_games.Game(board_size, komi=komi)
     game.set_player_code('b', 'one')
     game.set_player_code('w', 'two')
     if player_b is None:
         player_b = gtp_engine_fixtures.Test_player()
     if player_w is None:
         player_w = gtp_engine_fixtures.Test_player()
     engine_b = gtp_engine_fixtures.make_player_engine(player_b)
     engine_w = gtp_engine_fixtures.make_player_engine(player_w)
     channel_b = gtp_controller_test_support.Testing_gtp_channel(engine_b)
     channel_w = gtp_controller_test_support.Testing_gtp_channel(engine_w)
     controller_b = gtp_controller.Gtp_controller(channel_b, 'player one')
     controller_w = gtp_controller.Gtp_controller(channel_w, 'player two')
     game.set_player_controller('b', controller_b)
     game.set_player_controller('w', controller_w)
     self.game = game
     self.controller_b = controller_b
     self.controller_w = controller_w
     self.channel_b = channel_b
     self.channel_w = channel_w
     self.engine_b = channel_b.engine
     self.engine_w = channel_w.engine
     self.player_b = channel_b.engine.player
     self.player_w = channel_w.engine.player