Increase readability of Machine access

This commit is contained in:
Matt Nadareski
2025-05-02 16:46:20 -04:00
parent d5ae1dffaa
commit 7d35594040
33 changed files with 124 additions and 114 deletions

View File

@@ -36,7 +36,7 @@ namespace SabreTools.DatItems.Formats
public override object Clone()
{
var blank = new Blank();
blank.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey));
blank.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine());
blank.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
blank.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
blank.SetFieldValue<string?>(Models.Metadata.DatItem.TypeKey, GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue<ItemType>().AsStringValue());
@@ -89,7 +89,7 @@ namespace SabreTools.DatItems.Formats
Blank? newOther = other as Blank;
// If the machine information matches
return GetFieldValue<Machine>(DatItem.MachineKey) == newOther!.GetFieldValue<Machine>(DatItem.MachineKey);
return GetMachine() == newOther!.GetMachine();
}
#endregion