def apply(self, board):
    new_board = board
    zombies_to_clear = []
    for (i, move) in enumerate(self.moves):
        old_class = new_board.piece_class[move.start_index]
        opponent_square = move.find_opponent_square(new_board)
        zombies_to_clear.append(opponent_square)
        new_board = move.apply(new_board)
        new_board.owner[opponent_square] = Player.ZOMBIE
        if (i < (len(self.moves) - 1)):
            new_board.piece_class[move.end_index] = old_class
    for zombie in zombies_to_clear:
        new_board.remove_piece(zombie)
    return new_board
def apply(self, board):
    new_board = board
    zombies_to_clear = []
    for (i, move) in enumerate(self.moves):
        old_class = new_board.piece_class[move.start_index]
        opponent_square = move.find_opponent_square(new_board)
        zombies_to_clear.append(opponent_square)
        new_board = move.apply(new_board)
        new_board.owner[opponent_square] = Player.ZOMBIE
        if (i < (len(self.moves) - 1)):
            new_board.piece_class[move.end_index] = old_class
    for zombie in zombies_to_clear:
        new_board.remove_piece(zombie)
    return new_board