DatItems don't know about removing fields or ORPG

This commit is contained in:
Matt Nadareski
2020-12-13 23:09:24 -08:00
parent 8286fa6eb5
commit 8a354e9156
44 changed files with 1392 additions and 1924 deletions

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Serialization;
@@ -103,33 +102,6 @@ namespace SabreTools.DatItems
#endregion
#region Filtering
/// <inheritdoc/>
public override void RemoveFields(
List<DatItemField> datItemFields,
List<MachineField> machineFields)
{
// Remove common fields first
base.RemoveFields(datItemFields, machineFields);
// Remove the fields
if (datItemFields.Contains(DatItemField.Extension_Name))
Name = null;
}
/// <summary>
/// Set internal names to match One Rom Per Game (ORPG) logic
/// </summary>
public override void SetOneRomPerGame()
{
string[] splitname = Name.Split('.');
Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
Name = Path.GetFileName(Name);
}
#endregion
#region Sorting and Merging
/// <inheritdoc/>