def set(self): if self.board.is_game_over(): return self.move_stack = [move.__dict__ for move in self.board.move_stack] self.board_stack = [board.__dict__ for board in self.board.stack] self.board_state = chess._BoardState(self.board).__dict__ self.put()
def __init__(self, board): self.board_state = chess._BoardState(board) self.pockets_w = board.pockets[chess.WHITE].copy() self.pockets_b = board.pockets[chess.BLACK].copy()
def __init__(self, board): self.board_state = chess._BoardState(board) self.remaining_checks_w = board.remaining_checks[chess.WHITE] self.remaining_checks_b = board.remaining_checks[chess.BLACK]
def default_boardstate(): board = chess.Board() return chess._BoardState(board).__dict__
def get_boardstate(data): state = chess._BoardState(chess.Board()) for key, value in data.iteritems(): setattr(state, key, value) return state