<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_fields(store_name, field_names):
 """ A class-decorator that creates layout managers with a set of named fields. """

    def decorate(cls):
        def _add(index, name):
            def _set_dir(self, value): getattr(self, store_name)[index] = value
            def _get_dir(self): return getattr(self, store_name)[index]
            setattr(cls, name, property(_get_dir, _set_dir))

        for index, field_name in enumerate(field_names):
            _add(index, field_name)

        return cls

    return decorate