Ejemplo n.º 1
0
 def update_board(self, game_state: GameState):
     assert isinstance(game_state, SpookState)
     super().update_board(game_state)
     valid_moves = game_state.get_valid_moves()
     volume = game_state.calculate_volume()
     is_pass_valid = bool(valid_moves[volume])
     self.ui.pass_button.setVisible(is_pass_valid)
Ejemplo n.º 2
0
    def update_board(self, game_state: GameState):
        assert isinstance(game_state, SpaijiState)
        valid_moves = game_state.get_valid_moves()
        volume = game_state.calculate_volume()
        is_black_valid = valid_moves[:volume].any()
        is_white_valid = valid_moves[volume:].any()
        visible_move_types = []
        if is_black_valid:
            visible_move_types.append(MoveType.BLACK)
        if is_white_valid:
            visible_move_types.append(MoveType.WHITE)
        self.visible_move_types = visible_move_types

        super().update_board(game_state)