Cleanup of ModelBackedItem common functionality

This commit is contained in:
Matt Nadareski
2025-01-07 16:40:35 -05:00
parent b576f79c98
commit 6eaa7d0422
11 changed files with 921 additions and 962 deletions

View File

@@ -297,33 +297,6 @@ namespace SabreTools.DatItems
return filterRunner.Run(_internal);
}
/// <summary>
/// Remove a field from the DatItem
/// </summary>
/// <param name="fieldName">Field to remove</param>
/// <returns>True if the removal was successful, false otherwise</returns>
public bool RemoveField(string? fieldName)
=> FieldManipulator.RemoveField(_internal, fieldName);
/// <summary>
/// Replace a field from another DatItem
/// </summary>
/// <param name="other">DatItem to replace field from</param>
/// <param name="fieldName">Field to replace</param>
/// <returns>True if the replacement was successful, false otherwise</returns>
public bool ReplaceField(DatItem? other, string? fieldName)
=> FieldManipulator.ReplaceField(other?._internal, _internal, fieldName);
/// <summary>
/// Set a field in the DatItem from a mapping string
/// </summary>
/// <param name="fieldName">Field to set</param>
/// <param name="value">String representing the value to set</param>
/// <returns>True if the removal was successful, false otherwise</returns>
/// <remarks>This only performs minimal validation before setting</remarks>
public bool SetField(string? fieldName, string value)
=> FieldManipulator.SetField(_internal, fieldName, value);
#endregion
#region Sorting and Merging