Consolidate replacement code

This commit is contained in:
Matt Nadareski
2024-03-05 20:07:38 -05:00
parent 8c11eedbcd
commit 919973266c
9 changed files with 140 additions and 1009 deletions

View File

@@ -557,6 +557,15 @@ namespace SabreTools.DatItems
public bool RemoveField(string? fieldName)
=> FieldManipulator.RemoveField(_machine, fieldName);
/// <summary>
/// Replace a field from another Machine
/// </summary>
/// <param name="other">Machine 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(Machine? other, string? fieldName)
=> FieldManipulator.ReplaceField(other?._machine, _machine, fieldName);
/// <summary>
/// Set a field in the Machine from a mapping string
/// </summary>