[DatFiles/] Create blank games always

This commit is contained in:
Matt Nadareski
2018-03-21 01:59:40 -07:00
parent ecd6a70c8d
commit c72cf056da
6 changed files with 45 additions and 66 deletions

View File

@@ -651,8 +651,6 @@ namespace SabreTools.Library.DatFiles
// If no items were found for this machine, add a Blank placeholder
if (!containsItems)
{
if (this.KeepEmptyGames)
{
Blank blank = new Blank()
{
@@ -666,7 +664,6 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(blank, clean, remUnicode);
}
}
}
/// <summary>
/// Create and open an output file for writing direct from a dictionary

View File

@@ -185,6 +185,7 @@ namespace SabreTools.Library.DatFiles
RomOf = reader.GetAttribute("romof") ?? "",
SampleOf = reader.GetAttribute("sampleof") ?? "",
Devices = new List<string>(),
SlotOptions = new List<string>(),
MachineType = (machineType == MachineType.NULL ? MachineType.None : machineType),
};
@@ -494,8 +495,6 @@ namespace SabreTools.Library.DatFiles
// If no items were found for this machine, add a Blank placeholder
if (!containsItems)
{
if (this.KeepEmptyGames)
{
Blank blank = new Blank()
{
@@ -509,7 +508,6 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(blank, clean, remUnicode);
}
}
}
/// <summary>
/// Read slot information
@@ -539,12 +537,12 @@ namespace SabreTools.Library.DatFiles
// Get the roms from the machine
switch (reader.Name)
{
case "slotoption": // These get added as devices currently
case "slotoption":
// string slotoption_name = reader.GetAttribute("name");
string devname = reader.GetAttribute("devname");
if (!machine.Devices.Contains(devname))
if (!machine.SlotOptions.Contains(devname))
{
machine.Devices.Add(devname);
machine.SlotOptions.Add(devname);
}
// bool? slotoption_default = Utilities.GetYesNo(reader.GetAttribute("default"));
reader.Read();

View File

@@ -536,8 +536,6 @@ namespace SabreTools.Library.DatFiles
// If no items were found for this machine, add a Blank placeholder
if (!containsItems)
{
if (this.KeepEmptyGames)
{
Blank blank = new Blank()
{
@@ -551,7 +549,6 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(blank, clean, remUnicode);
}
}
}
/// <summary>
/// Read TruRip information

View File

@@ -198,8 +198,6 @@ namespace SabreTools.Library.DatFiles
// If no items were found for this machine, add a Blank placeholder
if (!containsItems)
{
if (this.KeepEmptyGames)
{
Blank blank = new Blank()
{
@@ -213,7 +211,6 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(blank, clean, remUnicode);
}
}
}
/// <summary>
/// Read dump information

View File

@@ -462,14 +462,7 @@ namespace SabreTools.Library.DatFiles
break;
default:
// By default, create a new Blank, just in case
if (this.KeepEmptyGames)
{
datItem = new Blank();
}
else
{
datItem = null;
}
break;
}

View File

@@ -230,8 +230,6 @@ namespace SabreTools.Library.DatFiles
// If no items were found for this machine, add a Blank placeholder
if (!containsItems)
{
if (this.KeepEmptyGames)
{
Blank blank = new Blank()
{
@@ -245,7 +243,6 @@ namespace SabreTools.Library.DatFiles
ParseAddHelper(blank, clean, remUnicode);
}
}
}
/// <summary>
/// Read part information