Update enum handling, part 1

This commit is contained in:
Matt Nadareski
2023-04-20 10:34:37 -04:00
parent 8921a09118
commit 1f601dfa3f
11 changed files with 1332 additions and 1123 deletions

View File

@@ -212,7 +212,7 @@ namespace SabreTools.DatFiles.Formats
bool containsItems = false;
Machine machine = new()
{
MachineType = (resource ? MachineType.Bios : MachineType.NULL),
MachineType = (resource ? MachineType.Bios : MachineType.None),
};
// If there's no subtree to the header, skip it
@@ -276,7 +276,10 @@ namespace SabreTools.DatFiles.Formats
string itemKey = cmpr.InternalName;
// Create the proper DatItem based on the type
ItemType itemType = itemKey.AsItemType() ?? ItemType.Rom;
ItemType itemType = itemKey.AsItemType();
if (itemType == ItemType.NULL)
itemType = ItemType.Rom;
DatItem item = DatItem.Create(itemType);
// Then populate it with information

View File

@@ -145,7 +145,7 @@ namespace SabreTools.DatFiles.Formats
bool containsItems = false;
Machine machine = new()
{
MachineType = MachineType.NULL,
MachineType = MachineType.None,
};
// If there's no subtree to the header, skip it

View File

@@ -302,7 +302,7 @@ namespace SabreTools.DatFiles.Formats
CloneOf = reader.GetAttribute("cloneof"),
RomOf = reader.GetAttribute("romof"),
SampleOf = reader.GetAttribute("sampleof"),
MachineType = (machineType == 0x0 ? MachineType.NULL : machineType),
MachineType = (machineType == 0x0 ? MachineType.None : machineType),
SourceFile = reader.GetAttribute("sourcefile"),
Runnable = reader.GetAttribute("runnable").AsRunnable(),

View File

@@ -490,7 +490,7 @@ namespace SabreTools.DatFiles.Formats
RomOf = reader.GetAttribute("romof"),
SampleOf = reader.GetAttribute("sampleof"),
MachineType = (machineType == 0x0 ? MachineType.NULL : machineType),
MachineType = (machineType == 0x0 ? MachineType.None : machineType),
};
if (Header.Type == "SuperDAT" && !keep)