[DatFile] Full non-merged should remove redundant sets

This commit is contained in:
Matt Nadareski
2017-01-11 20:27:49 -08:00
parent aab009ff36
commit ba72c180b7

View File

@@ -395,8 +395,11 @@ namespace SabreTools.Helper.Dats
// Now that we have looped through the cloneof tags, we loop through the romof tags // Now that we have looped through the cloneof tags, we loop through the romof tags
AddRomsFromBios(logger); AddRomsFromBios(logger);
// Finally, remove the romof and cloneof tags so it's not picked up by the manager // Then, remove the romof and cloneof tags so it's not picked up by the manager
RemoveTagsFromChild(logger); RemoveTagsFromChild(logger);
// Finally, remove all sets that are labeled as bios or device
RemoveBiosAndDeviceSets(logger);
} }
/// <summary> /// <summary>
@@ -819,6 +822,24 @@ namespace SabreTools.Helper.Dats
} }
} }
/// <summary>
/// Remove all BIOS and device sets
/// </summary>
/// <param name="logger"></param>
private void RemoveBiosAndDeviceSets(Logger logger)
{
List<string> games = Keys.ToList();
foreach (string game in games)
{
if (this[game].Count > 0
&& (this[game][0].Machine.MachineType == MachineType.Bios
|| this[game][0].Machine.MachineType == MachineType.Device))
{
Remove(game);
}
}
}
/// <summary> /// <summary>
/// Use romof tags to remove roms from the children /// Use romof tags to remove roms from the children
/// </summary> /// </summary>