Use Listxml serializer for writing

This commit is contained in:
Matt Nadareski
2023-08-01 13:30:34 -04:00
parent 35326db8a2
commit 8a56f8fd11
2 changed files with 759 additions and 66 deletions

View File

@@ -873,7 +873,7 @@ namespace SabreTools.DatFiles.Formats
Emulation = driver.Emulation.AsSupportStatus(),
Cocktail = driver.Cocktail.AsSupportStatus(),
SaveState = driver.SaveState.AsSupported(),
RequiresArtwork = driver.SaveState.AsYesNo(),
RequiresArtwork = driver.RequiresArtwork.AsYesNo(),
Unofficial = driver.Unofficial.AsYesNo(),
NoSoundHardware = driver.NoSoundHardware.AsYesNo(),
Incomplete = driver.Incomplete.AsYesNo(),
@@ -1015,7 +1015,7 @@ namespace SabreTools.DatFiles.Formats
},
};
var extensions = new List<SlotOption>();
var slotoptions = new List<SlotOption>();
foreach (var slotoption in slot.SlotOption ?? Array.Empty<Models.Listxml.SlotOption>())
{
var slotoptionItem = new SlotOption
@@ -1024,11 +1024,11 @@ namespace SabreTools.DatFiles.Formats
DeviceName = slotoption.DevName,
Default = slotoption.Default.AsYesNo(),
};
extensions.Add(slotoptionItem);
slotoptions.Add(slotoptionItem);
}
if (extensions.Any())
item.SlotOptions = extensions;
if (slotoptions.Any())
item.SlotOptions = slotoptions;
item.CopyMachineInformation(machine);
ParseAddHelper(item, statsOnly);