def updatechess(self): import gtk import parsemove #the own thing here for parsing move data from pychess #print ".", gtk.main_iteration(block=False) if self.g is None and self.i.globalgamemodel is not None: self.g = self.i.globalgamemodel if self.g is not None: #print g.players, id(g.boards[-1]), g.boards[-1] board = self.g.boards[-1] if board is not self.prev_board: print "BOARD:", board if len(board.board.history) > 0: prevmove = board.board.history[-1][0] parsemove.parsemove(board, self.prev_arBoard, prevmove) #should use prev_board for right current color XXX self.prev_board = board self.prev_arBoard = board.board.arBoard[:]
def updatechess(self): import gtk import parsemove #the own thing here for parsing move data from pychess #print ".", gtk.main_iteration(block=False) if self.g is None and self.i.globalgamemodel is not None: self.g = self.i.globalgamemodel if self.g is not None: #print g.players, id(g.boards[-1]), g.boards[-1] board = self.g.boards[-1] if board is not self.prev_board: print "BOARD:", board if len(board.board.history) > 0: prevmove = board.board.history[-1][0] parsemove.parsemove( board, self.prev_arBoard, prevmove ) #should use prev_board for right current color XXX self.prev_board = board self.prev_arBoard = board.board.arBoard[:]
def updatechess(): #print ".", global g, prev_board, prev_arBoard for _ in range(100): gtk.main_iteration(block=False) #gtk.gdk.threads_enter() if g is None and i.globalgamemodel is not None: g = i.globalgamemodel board = g.boards[-1] msg.send("BEGIN:%s" % board.board.arBoard.tostring()) if g is not None: #print g.players, id(g.boards[-1]), g.boards[-1] board = g.boards[-1] if board is not prev_board: #print "BOARD:", board if len(board.board.history) > 0: prevmove = board.board.history[-1][0] parsemove.parsemove(board, prev_arBoard, prevmove) prev_board = board prev_arBoard = board.board.arBoard[:]
def updatechess(): # print ".", global g, prev_board, prev_arBoard for _ in range(100): gtk.main_iteration(block=False) # gtk.gdk.threads_enter() if g is None and i.globalgamemodel is not None: g = i.globalgamemodel board = g.boards[-1] msg.send("BEGIN:%s" % board.board.arBoard.tostring()) if g is not None: # print g.players, id(g.boards[-1]), g.boards[-1] board = g.boards[-1] if board is not prev_board: # print "BOARD:", board if len(board.board.history) > 0: prevmove = board.board.history[-1][0] parsemove.parsemove(board, prev_arBoard, prevmove) prev_board = board prev_arBoard = board.board.arBoard[:]