Consolidate setter code

This commit is contained in:
Matt Nadareski
2024-03-05 17:17:40 -05:00
parent d43a275f8c
commit 6987ec2641
51 changed files with 181 additions and 1175 deletions

View File

@@ -112,25 +112,5 @@ namespace SabreTools.DatItems.Formats
}
#endregion
#region Manipulation
/// <inheritdoc/>
public override bool SetField(DatItemField datItemField, string value)
{
// Get the correct internal field name
string? fieldName = datItemField switch
{
DatItemField.Filter => Models.Metadata.SoftwareList.FilterKey,
DatItemField.SoftwareListStatus => Models.Metadata.SoftwareList.StatusKey,
DatItemField.Tag => Models.Metadata.SoftwareList.TagKey,
_ => null,
};
// Set the field and return
return FieldManipulator.SetField(_internal, fieldName, value);
}
#endregion
}
}