Beispiel #1
0
 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()
Beispiel #2
0
 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()
Beispiel #3
0
 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]
Beispiel #4
0
def default_boardstate():
    board = chess.Board()
    return chess._BoardState(board).__dict__
Beispiel #5
0
def get_boardstate(data):
    state = chess._BoardState(chess.Board())
    for key, value in data.iteritems():
        setattr(state, key, value)
    return state