mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Consolidate removal code
This commit is contained in:
@@ -101,20 +101,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -62,20 +62,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -138,19 +138,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -96,21 +96,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -60,9 +60,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField) => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value) => true;
|
||||
|
||||
|
||||
@@ -112,22 +112,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -98,27 +98,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -99,23 +99,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -111,23 +111,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -134,21 +134,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -202,31 +202,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -114,22 +114,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -140,24 +140,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -73,19 +73,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -99,23 +99,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -162,21 +162,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -111,23 +111,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -288,27 +288,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -74,19 +74,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -234,33 +234,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -165,27 +165,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -73,19 +73,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -96,22 +96,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -328,20 +328,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
// TODO: Figure out what fields go here
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -83,20 +83,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -119,23 +119,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -83,20 +83,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -186,23 +186,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -90,20 +90,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -83,21 +83,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -77,20 +77,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -96,21 +96,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -120,23 +120,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -190,20 +190,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
// TODO: Figure out what fields go here
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -599,60 +599,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -73,19 +73,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -178,20 +178,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
// TODO: Figure out what fields go here
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -83,20 +83,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -88,19 +88,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -96,22 +96,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -115,22 +115,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -65,20 +65,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
@@ -228,20 +228,6 @@ namespace SabreTools.DatItems.Formats
|
||||
|
||||
#region Manipulation
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool RemoveField(DatItemField datItemField)
|
||||
{
|
||||
// Get the correct internal field name
|
||||
string? fieldName = datItemField switch
|
||||
{
|
||||
// TODO: Figure out what fields go here
|
||||
_ => null,
|
||||
};
|
||||
|
||||
// Remove the field and return
|
||||
return FieldManipulator.RemoveField(_internal, fieldName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool SetField(DatItemField datItemField, string value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user