Example #1
0
 def callback2(valid):
     """called when move is executed and validated in the engine"""
     if valid:
         self._moves.play(move)
         self.broadcast(ClientGameCommand.play(self.id, color, move))
         if self._moves.finished():
             self.engine.final_score(callback3)
         else:
             if ((color == "black") and (self._config.white == "GNUGo")) or\
                ((color == "white") and (self._config.black == "GNUGo")):
                     self.play(None, lambda: None, genmove=True)
     
     callback1(valid)
Example #2
0
 def callback2_genmove(move):
     """called when move is executed using genmove"""
     self._moves.play(move)
     self.broadcast(ClientGameCommand.play(self.id, color, move))
     if self._moves.finished():
         self.engine.final_score(callback3)