Use DictionaryBase for setters

This commit is contained in:
Matt Nadareski
2024-03-05 02:20:12 -05:00
parent 539e4367e0
commit 2b2aa5aff8
47 changed files with 845 additions and 796 deletions

View File

@@ -1,6 +1,7 @@
using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core;
using SabreTools.Filter;
// TODO: Add item mappings for all fields
namespace SabreTools.DatItems.Formats
@@ -224,5 +225,37 @@ namespace SabreTools.DatItems.Formats
}
#endregion
#region Manipulation
/// <inheritdoc/>
public override bool RemoveField(DatItemField datItemField)
{
// Get the correct internal field name
string? fieldName = datItemField switch
{
// TODO: Figure out what fields go here
_ => null,
};
// Remove the field and return
return FieldManipulator.RemoveField(_internal, fieldName);
}
/// <inheritdoc/>
public override bool SetField(DatItemField datItemField, string value)
{
// Get the correct internal field name
string? fieldName = datItemField switch
{
// TODO: Figure out what fields go here
_ => null,
};
// Set the field and return
return FieldManipulator.SetField(_internal, fieldName, value);
}
#endregion
}
}