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:
@@ -371,6 +371,17 @@ namespace SabreTools.DatItems
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Manipulation
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove a field from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="datItemField">Item field to remove</param>
|
||||||
|
/// <returns>True if the removal was successful, false otherwise</returns>
|
||||||
|
public abstract bool RemoveField(DatItemField datItemField);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Sorting and Merging
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Linq;
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -97,5 +98,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -58,5 +59,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -134,5 +135,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -92,5 +93,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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
|
#endregion
|
||||||
|
|
||||||
|
#region Manipulation
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override bool RemoveField(DatItemField datItemField) => true;
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
|||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -108,5 +109,25 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -94,5 +95,30 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -95,5 +96,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -107,5 +108,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -130,5 +131,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -198,5 +199,34 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -110,5 +111,25 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -136,5 +137,27 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -95,5 +96,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -158,5 +159,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -107,5 +108,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.FileTypes;
|
using SabreTools.FileTypes;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -285,6 +286,31 @@ namespace SabreTools.DatItems.Formats
|
|||||||
|
|
||||||
#endregion
|
#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
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -70,5 +71,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -230,5 +231,36 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -161,5 +162,30 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -92,5 +93,25 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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.Linq;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.FileTypes;
|
using SabreTools.FileTypes;
|
||||||
|
using SabreTools.Filter;
|
||||||
using SabreTools.Matching;
|
using SabreTools.Matching;
|
||||||
|
|
||||||
// TODO: Add item mappings for all fields
|
// TODO: Add item mappings for all fields
|
||||||
@@ -326,6 +326,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
|
|
||||||
#endregion
|
#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
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -79,5 +80,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -115,5 +116,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -79,5 +80,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.FileTypes;
|
using SabreTools.FileTypes;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -184,6 +184,27 @@ namespace SabreTools.DatItems.Formats
|
|||||||
|
|
||||||
#endregion
|
#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
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Linq;
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -86,5 +87,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -79,5 +80,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -73,5 +74,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -92,5 +93,24 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -116,5 +117,26 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
// TODO: Add item mappings for all fields
|
// TODO: Add item mappings for all fields
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
@@ -186,5 +187,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.FileTypes;
|
using SabreTools.FileTypes;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -597,6 +597,64 @@ namespace SabreTools.DatItems.Formats
|
|||||||
|
|
||||||
#endregion
|
#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
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -69,5 +70,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
// TODO: Add item mappings for all fields
|
// TODO: Add item mappings for all fields
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
@@ -174,5 +175,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -79,5 +80,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -84,5 +85,22 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -92,5 +93,25 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -111,5 +112,25 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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 System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
@@ -61,5 +62,23 @@ namespace SabreTools.DatItems.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Newtonsoft.Json;
|
|||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
using SabreTools.Core;
|
using SabreTools.Core;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
|
using SabreTools.Filter;
|
||||||
|
|
||||||
namespace SabreTools.DatItems
|
namespace SabreTools.DatItems
|
||||||
{
|
{
|
||||||
@@ -538,5 +539,82 @@ namespace SabreTools.DatItems
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Manipulation
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove a field from the Machine
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="machineField">Machine field to remove</param>
|
||||||
|
/// <returns>True if the removal was successful, false otherwise</returns>
|
||||||
|
public bool RemoveField(MachineField machineField)
|
||||||
|
{
|
||||||
|
// Get the correct internal field name
|
||||||
|
string? fieldName = machineField switch
|
||||||
|
{
|
||||||
|
MachineField.Board => Models.Metadata.Machine.BoardKey,
|
||||||
|
MachineField.Buttons => Models.Metadata.Machine.ButtonsKey,
|
||||||
|
MachineField.Category => Models.Metadata.Machine.CategoryKey,
|
||||||
|
MachineField.CloneOf => Models.Metadata.Machine.CloneOfKey,
|
||||||
|
MachineField.CloneOfID => Models.Metadata.Machine.CloneOfIdKey,
|
||||||
|
MachineField.Comment => Models.Metadata.Machine.CommentKey,
|
||||||
|
MachineField.Control => Models.Metadata.Machine.ControlKey,
|
||||||
|
MachineField.Country => Models.Metadata.Machine.CountryKey,
|
||||||
|
//MachineField.CRC => Models.Metadata.Machine.CRCKey,
|
||||||
|
MachineField.Description => Models.Metadata.Machine.DescriptionKey,
|
||||||
|
//MachineField.Developer => Models.Metadata.Machine.DeveloperKey,
|
||||||
|
MachineField.DisplayCount => Models.Metadata.Machine.DisplayCountKey,
|
||||||
|
MachineField.DisplayType => Models.Metadata.Machine.DisplayTypeKey,
|
||||||
|
//MachineField.Enabled => Models.Metadata.Machine.EnabledKey,
|
||||||
|
MachineField.GenMSXID => Models.Metadata.Machine.GenMSXIDKey,
|
||||||
|
//MachineField.Genre => Models.Metadata.Machine.GenreKey,
|
||||||
|
MachineField.History => Models.Metadata.Machine.HistoryKey,
|
||||||
|
MachineField.ID => Models.Metadata.Machine.IdKey,
|
||||||
|
MachineField.Manufacturer => Models.Metadata.Machine.ManufacturerKey,
|
||||||
|
MachineField.Name => Models.Metadata.Machine.NameKey,
|
||||||
|
MachineField.Players => Models.Metadata.Machine.PlayersKey,
|
||||||
|
MachineField.Publisher => Models.Metadata.Machine.PublisherKey,
|
||||||
|
//MachineField.Ratings => Models.Metadata.Machine.RatingsKey,
|
||||||
|
MachineField.RebuildTo => Models.Metadata.Machine.RebuildToKey,
|
||||||
|
//MachineField.RelatedTo => Models.Metadata.Machine.RelatedToKey,
|
||||||
|
MachineField.RomOf => Models.Metadata.Machine.RomOfKey,
|
||||||
|
MachineField.Rotation => Models.Metadata.Machine.RotationKey,
|
||||||
|
MachineField.Runnable => Models.Metadata.Machine.RunnableKey,
|
||||||
|
MachineField.SampleOf => Models.Metadata.Machine.SampleOfKey,
|
||||||
|
//MachineField.Score => Models.Metadata.Machine.ScoreKey,
|
||||||
|
MachineField.SourceFile => Models.Metadata.Machine.SourceFileKey,
|
||||||
|
MachineField.Status => Models.Metadata.Machine.StatusKey,
|
||||||
|
//MachineField.Subgenre => Models.Metadata.Machine.SubgenreKey,
|
||||||
|
MachineField.Supported => Models.Metadata.Machine.SupportedKey,
|
||||||
|
MachineField.System => Models.Metadata.Machine.SystemKey,
|
||||||
|
//MachineField.TitleID => Models.Metadata.Machine.TitleIDKey,
|
||||||
|
//MachineField.Type => Models.Metadata.Machine.TypeKey,
|
||||||
|
MachineField.Year => Models.Metadata.Machine.YearKey,
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
|
||||||
|
// A null value means special handling is needed
|
||||||
|
if (fieldName == null)
|
||||||
|
{
|
||||||
|
switch (machineField)
|
||||||
|
{
|
||||||
|
case MachineField.CRC: Crc = null; return true;
|
||||||
|
case MachineField.Developer: Developer = null; return true;
|
||||||
|
case MachineField.Enabled: Enabled = null; return true;
|
||||||
|
case MachineField.Genre: Genre = null; return true;
|
||||||
|
case MachineField.Ratings: Ratings = null; return true;
|
||||||
|
case MachineField.RelatedTo: RelatedTo = null; return true;
|
||||||
|
case MachineField.Score: Score = null; return true;
|
||||||
|
case MachineField.Subgenre: Subgenre = null; return true;
|
||||||
|
case MachineField.TitleID: TitleID = null; return true;
|
||||||
|
case MachineField.Type: MachineType = MachineType.None; return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the field and return
|
||||||
|
return FieldManipulator.RemoveField(_machine, fieldName);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SabreTools.Core\SabreTools.Core.csproj" />
|
<ProjectReference Include="..\SabreTools.Core\SabreTools.Core.csproj" />
|
||||||
<ProjectReference Include="..\SabreTools.FileTypes\SabreTools.FileTypes.csproj" />
|
<ProjectReference Include="..\SabreTools.FileTypes\SabreTools.FileTypes.csproj" />
|
||||||
|
<ProjectReference Include="..\SabreTools.Filter\SabreTools.Filter.csproj" />
|
||||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ namespace SabreTools.Filter
|
|||||||
string? name = machine.ReadString(Header.NameKey);
|
string? name = machine.ReadString(Header.NameKey);
|
||||||
string? description = machine.ReadString(Header.DescriptionKey);
|
string? description = machine.ReadString(Header.DescriptionKey);
|
||||||
|
|
||||||
|
// Sanitize the description string
|
||||||
|
description = description?
|
||||||
|
.Replace('/', '_')
|
||||||
|
.Replace("\"", "''")
|
||||||
|
.Replace(":", " -");
|
||||||
|
|
||||||
// Replace the name with the description
|
// Replace the name with the description
|
||||||
machine[Header.NameKey] = description;
|
machine[Header.NameKey] = description;
|
||||||
return (true, name);
|
return (true, name);
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
#if NET452_OR_GREATER || NETCOREAPP
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using SabreTools.Models;
|
using SabreTools.Models;
|
||||||
|
#endif
|
||||||
using SabreTools.Models.Metadata;
|
using SabreTools.Models.Metadata;
|
||||||
|
|
||||||
namespace SabreTools.Filter
|
namespace SabreTools.Filter
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user