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:
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -97,5 +98,23 @@ 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.Default => Models.Metadata.Adjuster.DefaultKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -58,5 +59,23 @@ 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.Analog_Mask => Models.Metadata.Analog.MaskKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -134,5 +135,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -92,5 +93,24 @@ 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.Default => Models.Metadata.BiosSet.DefaultKey,
|
||||
DatItemField.Description => Models.Metadata.BiosSet.DescriptionKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,5 +57,12 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField) => true;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -108,5 +109,25 @@ 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.ChipType => Models.Metadata.Chip.ChipTypeKey,
|
||||
DatItemField.Clock => Models.Metadata.Chip.ClockKey,
|
||||
DatItemField.Tag => Models.Metadata.Chip.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -94,5 +95,30 @@ 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.Mask => Models.Metadata.Condition.MaskKey,
|
||||
DatItemField.Condition_Mask => Models.Metadata.Condition.MaskKey,
|
||||
DatItemField.Relation => Models.Metadata.Condition.RelationKey,
|
||||
DatItemField.Condition_Relation => Models.Metadata.Condition.RelationKey,
|
||||
DatItemField.Tag => Models.Metadata.Condition.TagKey,
|
||||
DatItemField.Condition_Tag => Models.Metadata.Condition.TagKey,
|
||||
DatItemField.Value => Models.Metadata.Condition.ValueKey,
|
||||
DatItemField.Condition_Value => Models.Metadata.Condition.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -107,5 +108,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.Default => Models.Metadata.ConfSetting.DefaultKey,
|
||||
DatItemField.Setting_Default => Models.Metadata.ConfSetting.DefaultKey,
|
||||
DatItemField.Value => Models.Metadata.ConfSetting.ValueKey,
|
||||
DatItemField.Setting_Value => Models.Metadata.ConfSetting.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -130,5 +131,24 @@ 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.Mask => Models.Metadata.Configuration.MaskKey,
|
||||
DatItemField.Tag => Models.Metadata.Configuration.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -198,5 +199,34 @@ 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.Control_Buttons => Models.Metadata.Control.ButtonsKey,
|
||||
DatItemField.Control_KeyDelta => Models.Metadata.Control.KeyDeltaKey,
|
||||
DatItemField.Control_Maximum => Models.Metadata.Control.MaximumKey,
|
||||
DatItemField.Control_Minimum => Models.Metadata.Control.MinimumKey,
|
||||
DatItemField.Control_Player => Models.Metadata.Control.PlayerKey,
|
||||
DatItemField.Control_RequiredButtons => Models.Metadata.Control.ReqButtonsKey,
|
||||
DatItemField.Control_Reverse => Models.Metadata.Control.ReverseKey,
|
||||
DatItemField.Control_Sensitivity => Models.Metadata.Control.SensitivityKey,
|
||||
DatItemField.Control_Type => Models.Metadata.Control.ControlTypeKey,
|
||||
DatItemField.Control_Ways => Models.Metadata.Control.WaysKey,
|
||||
DatItemField.Control_Ways2 => Models.Metadata.Control.Ways2Key,
|
||||
DatItemField.Control_Ways3 => Models.Metadata.Control.Ways3Key,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -110,5 +111,25 @@ 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.AreaEndianness => Models.Metadata.DataArea.EndiannessKey,
|
||||
DatItemField.AreaSize => Models.Metadata.DataArea.SizeKey,
|
||||
DatItemField.AreaWidth => Models.Metadata.DataArea.WidthKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -136,5 +137,27 @@ 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.DeviceType => Models.Metadata.Device.DeviceTypeKey,
|
||||
DatItemField.FixedImage => Models.Metadata.Device.FixedImageKey,
|
||||
DatItemField.Interface => Models.Metadata.Device.InterfaceKey,
|
||||
DatItemField.Mandatory => Models.Metadata.Device.MandatoryKey,
|
||||
DatItemField.Tag => Models.Metadata.Device.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.DipLocation.InvertedKey,
|
||||
DatItemField.Location_Inverted => Models.Metadata.DipLocation.InvertedKey,
|
||||
DatItemField.Number => Models.Metadata.DipLocation.NumberKey,
|
||||
DatItemField.Location_Number => Models.Metadata.DipLocation.NumberKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -158,5 +159,24 @@ 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.Mask => Models.Metadata.DipSwitch.MaskKey,
|
||||
DatItemField.Tag => Models.Metadata.DipSwitch.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -107,5 +108,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.Default => Models.Metadata.DipValue.DefaultKey,
|
||||
DatItemField.Setting_Default => Models.Metadata.DipValue.DefaultKey,
|
||||
DatItemField.Value => Models.Metadata.DipValue.ValueKey,
|
||||
DatItemField.Setting_Value => Models.Metadata.DipValue.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.FileTypes;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -285,6 +286,31 @@ 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.Index => Models.Metadata.Disk.IndexKey,
|
||||
DatItemField.MD5 => Models.Metadata.Disk.MD5Key,
|
||||
DatItemField.Merge => Models.Metadata.Disk.MergeKey,
|
||||
DatItemField.Optional => Models.Metadata.Disk.OptionalKey,
|
||||
DatItemField.Region => Models.Metadata.Disk.RegionKey,
|
||||
DatItemField.SHA1 => Models.Metadata.Disk.SHA1Key,
|
||||
DatItemField.Status => Models.Metadata.Disk.StatusKey,
|
||||
DatItemField.Writable => Models.Metadata.Disk.WritableKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sorting and Merging
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -70,5 +71,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -230,5 +231,36 @@ 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.DisplayType => Models.Metadata.Display.DisplayTypeKey,
|
||||
DatItemField.FlipX => Models.Metadata.Display.FlipXKey,
|
||||
DatItemField.HBEnd => Models.Metadata.Display.HBEndKey,
|
||||
DatItemField.HBStart => Models.Metadata.Display.HBStartKey,
|
||||
DatItemField.Height => Models.Metadata.Display.HeightKey,
|
||||
DatItemField.HTotal => Models.Metadata.Display.HTotalKey,
|
||||
DatItemField.PixClock => Models.Metadata.Display.PixClockKey,
|
||||
DatItemField.Refresh => Models.Metadata.Display.RefreshKey,
|
||||
DatItemField.Rotate => Models.Metadata.Display.RotateKey,
|
||||
DatItemField.Tag => Models.Metadata.Display.TagKey,
|
||||
DatItemField.VBEnd => Models.Metadata.Display.VBEndKey,
|
||||
DatItemField.VBStart => Models.Metadata.Display.VBStartKey,
|
||||
DatItemField.VTotal => Models.Metadata.Display.VTotalKey,
|
||||
DatItemField.Width => Models.Metadata.Display.WidthKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -161,5 +162,30 @@ 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.CocktailStatus => Models.Metadata.Driver.CocktailKey,
|
||||
DatItemField.EmulationStatus => Models.Metadata.Driver.EmulationKey,
|
||||
DatItemField.Incomplete => Models.Metadata.Driver.IncompleteKey,
|
||||
DatItemField.NoSoundHardware => Models.Metadata.Driver.NoSoundHardwareKey,
|
||||
DatItemField.RequiresArtwork => Models.Metadata.Driver.RequiresArtworkKey,
|
||||
DatItemField.SaveStateStatus => Models.Metadata.Driver.SaveStateKey,
|
||||
DatItemField.SupportStatus => Models.Metadata.Driver.StatusKey,
|
||||
DatItemField.Unofficial => Models.Metadata.Driver.UnofficialKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -92,5 +93,25 @@ 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.FeatureOverall => Models.Metadata.Feature.OverallKey,
|
||||
DatItemField.FeatureStatus => Models.Metadata.Feature.StatusKey,
|
||||
DatItemField.FeatureType => Models.Metadata.Feature.FeatureTypeKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.FileTypes;
|
||||
using SabreTools.Filter;
|
||||
using SabreTools.Matching;
|
||||
|
||||
// TODO: Add item mappings for all fields
|
||||
@@ -326,6 +326,24 @@ 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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sorting and Merging
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -79,5 +80,23 @@ 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.Value => Models.Metadata.Info.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -115,5 +116,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.Coins => Models.Metadata.Input.CoinsKey,
|
||||
DatItemField.Players => Models.Metadata.Input.PlayersKey,
|
||||
DatItemField.Service => Models.Metadata.Input.ServiceKey,
|
||||
DatItemField.Tilt => Models.Metadata.Input.TiltKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -79,5 +80,23 @@ 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.Instance_BriefName => Models.Metadata.Instance.BriefNameKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.FileTypes;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -184,6 +184,27 @@ 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.MD5 => Models.Metadata.Media.MD5Key,
|
||||
DatItemField.SHA1 => Models.Metadata.Media.SHA1Key,
|
||||
DatItemField.SHA256 => Models.Metadata.Media.SHA256Key,
|
||||
DatItemField.SpamSum => Models.Metadata.Media.SpamSumKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sorting and Merging
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -86,5 +87,23 @@ 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.Part_Interface => Models.Metadata.Part.InterfaceKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -79,5 +80,24 @@ 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.Value => Models.Metadata.Feature.ValueKey,
|
||||
DatItemField.Part_Feature_Value => Models.Metadata.Feature.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -73,5 +74,23 @@ 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.Tag => Models.Metadata.Port.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -92,5 +93,24 @@ 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.Content => Models.Metadata.RamOption.ContentKey,
|
||||
DatItemField.Default => Models.Metadata.RamOption.DefaultKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -116,5 +117,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.Date => Models.Metadata.Release.DateKey,
|
||||
DatItemField.Default => Models.Metadata.Release.DefaultKey,
|
||||
DatItemField.Language => Models.Metadata.Release.LanguageKey,
|
||||
DatItemField.Region => Models.Metadata.Release.RegionKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -186,5 +187,23 @@ 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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.FileTypes;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -597,6 +597,64 @@ 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.AltName => Models.Metadata.Rom.AltRomnameKey,
|
||||
DatItemField.AltTitle => Models.Metadata.Rom.AltTitleKey,
|
||||
DatItemField.ArchiveDotOrgFormat => Models.Metadata.Rom.FormatKey,
|
||||
DatItemField.ArchiveDotOrgSource => Models.Metadata.Rom.SourceKey,
|
||||
DatItemField.Bios => Models.Metadata.Rom.BiosKey,
|
||||
//DatItemField.Boot => Models.Metadata.Rom.BootKey,
|
||||
DatItemField.CRC => Models.Metadata.Rom.CRCKey,
|
||||
DatItemField.Date => Models.Metadata.Rom.DateKey,
|
||||
DatItemField.Inverted => Models.Metadata.Rom.InvertedKey,
|
||||
DatItemField.LoadFlag => Models.Metadata.Rom.LoadFlagKey,
|
||||
DatItemField.MD5 => Models.Metadata.Rom.MD5Key,
|
||||
DatItemField.Merge => Models.Metadata.Rom.MergeKey,
|
||||
DatItemField.MIA => Models.Metadata.Rom.MIAKey,
|
||||
DatItemField.Offset => Models.Metadata.Rom.OffsetKey,
|
||||
DatItemField.OpenMSXSubType => Models.Metadata.Rom.OpenMSXMediaType, // TODO: Fix with Key suffix
|
||||
DatItemField.OpenMSXType => Models.Metadata.Rom.OpenMSXType, // TODO: Fix with Key suffix
|
||||
DatItemField.Optional => Models.Metadata.Rom.OptionalKey,
|
||||
//DatItemField.Original => Models.Metadata.Rom.OriginalKey,
|
||||
DatItemField.OriginalFilename => Models.Metadata.Rom.OriginalKey,
|
||||
DatItemField.Region => Models.Metadata.Rom.RegionKey,
|
||||
DatItemField.Remark => Models.Metadata.Rom.RemarkKey,
|
||||
DatItemField.Rotation => Models.Metadata.Rom.RotationKey,
|
||||
DatItemField.SHA1 => Models.Metadata.Rom.SHA1Key,
|
||||
DatItemField.SHA256 => Models.Metadata.Rom.SHA256Key,
|
||||
DatItemField.SHA384 => Models.Metadata.Rom.SHA384Key,
|
||||
DatItemField.SHA512 => Models.Metadata.Rom.SHA512Key,
|
||||
DatItemField.Size => Models.Metadata.Rom.SizeKey,
|
||||
DatItemField.SpamSum => Models.Metadata.Rom.SpamSumKey,
|
||||
DatItemField.Status => Models.Metadata.Rom.StatusKey,
|
||||
DatItemField.Summation => Models.Metadata.Rom.SummationKey,
|
||||
DatItemField.Value => Models.Metadata.Rom.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// A null value means special handling is needed
|
||||
if (fieldName == null)
|
||||
{
|
||||
switch (datItemField)
|
||||
{
|
||||
case DatItemField.Boot: Boot = null; return true;
|
||||
case DatItemField.Original: Original = null; return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sorting and Merging
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -174,5 +175,23 @@ 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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -79,5 +80,23 @@ 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.Value => Models.Metadata.SharedFeat.ValueKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -84,5 +85,22 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -92,5 +93,25 @@ 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.Default => Models.Metadata.SlotOption.DefaultKey,
|
||||
DatItemField.SlotOption_Default => Models.Metadata.SlotOption.DefaultKey,
|
||||
DatItemField.SlotOption_DeviceName => Models.Metadata.SlotOption.DevNameKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Core.Tools;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -111,5 +112,25 @@ 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.Filter => Models.Metadata.SoftwareList.FilterKey,
|
||||
DatItemField.SoftwareListStatus => Models.Metadata.SoftwareList.StatusKey,
|
||||
DatItemField.Tag => Models.Metadata.SoftwareList.TagKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using SabreTools.Core;
|
||||
using SabreTools.Filter;
|
||||
|
||||
namespace SabreTools.DatItems.Formats
|
||||
{
|
||||
@@ -61,5 +62,23 @@ 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.Default => Models.Metadata.Sound.ChannelsKey,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user