def get_possible_captures(self, board: Board, turn: int) -> set: captures = piece_utils.line_of_sight_captures(board, self, self.__captures, 1) x, y = self.get_position() left = x - 1, y if self.__can_be_captured_en_passant(board, left, turn): captures.add(board.get_piece_at(left).get()) right = x + 1, y if self.__can_be_captured_en_passant(board, right, turn): captures.add(board.get_piece_at(right).get()) return captures
def get_possible_captures(self, board: Board, turn: int) -> set: return piece_utils.line_of_sight_captures(board, self, self.__directions)
def get_possible_captures(self, board: Board, turn: int) -> set: captures = piece_utils.line_of_sight_captures(board, self, self.__directions, 1) captures = set(filter(lambda x: self.__can_capture_there(board, x, turn), captures)) return set(captures)