mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use DictionaryBase for removal
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -95,5 +96,26 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
DatItemField.Inverted => Models.Metadata.ConfLocation.InvertedKey,
|
||||
DatItemField.Location_Inverted => Models.Metadata.ConfLocation.InvertedKey,
|
||||
DatItemField.Number => Models.Metadata.ConfLocation.NumberKey,
|
||||
DatItemField.Location_Number => Models.Metadata.ConfLocation.NumberKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user