mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Update enum handling, part 1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user