Replacement code to own class

This commit is contained in:
Matt Nadareski
2021-02-01 12:35:59 -08:00
parent c8c38228e3
commit bb7f078802
9 changed files with 1144 additions and 1102 deletions

View File

@@ -540,11 +540,25 @@ namespace SabreTools.Filtering
List<DatItem> items = datFile.Items[key];
for (int i = 0; i < items.Count; i++)
{
DatItemTool.SetOneRomPerGame(items[i]);
SetOneRomPerGame(items[i]);
}
});
}
/// <summary>
/// Set internal names to match One Rom Per Game (ORPG) logic
/// </summary>
/// <param name="datItem">DatItem to run logic on</param>
internal void SetOneRomPerGame(DatItem datItem)
{
if (datItem.GetName() == null)
return;
string[] splitname = datItem.GetName().Split('.');
datItem.Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
datItem.SetName(Path.GetFileName(datItem.GetName()));
}
/// <summary>
/// Strip the dates from the beginning of scene-style set names
/// </summary>