mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Increase readability of Machine access
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
rom.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey)?.Clone() as Machine);
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine()?.Clone() as Machine);
|
||||
rom.SetFieldValue<Part>(Rom.PartKey, GetFieldValue<Part>(Disk.PartKey)?.Clone() as Part);
|
||||
rom.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
rom.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey)?.Clone() as Source);
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace SabreTools.DatItems.Formats
|
||||
Format = this.Format,
|
||||
};
|
||||
file.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
file.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey)!.Clone() as Machine ?? new Machine());
|
||||
file.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine()!.Clone() as Machine ?? new Machine());
|
||||
file.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
file.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace SabreTools.DatItems.Formats
|
||||
rom.SetFieldValue<string?>(Models.Metadata.Rom.SHA256Key, SHA256);
|
||||
|
||||
rom.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey)?.Clone() as Machine);
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine()?.Clone() as Machine);
|
||||
rom.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
rom.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace SabreTools.DatItems.Formats
|
||||
var rom = new Rom(_internal.ConvertToRom()!);
|
||||
|
||||
rom.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey));
|
||||
rom.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine());
|
||||
rom.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
rom.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace SabreTools.DatItems.Formats
|
||||
Origin = this.Origin,
|
||||
};
|
||||
releaseDetails.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
releaseDetails.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey));
|
||||
releaseDetails.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine());
|
||||
releaseDetails.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
releaseDetails.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
releaseDetails.SetFieldValue<string?>(Models.Metadata.DatItem.TypeKey, GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue<ItemType>().AsStringValue());
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace SabreTools.DatItems.Formats
|
||||
BoxBarcode = this.BoxBarcode,
|
||||
};
|
||||
serials.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
serials.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey));
|
||||
serials.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine());
|
||||
serials.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
serials.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
serials.SetFieldValue<string?>(Models.Metadata.DatItem.TypeKey, GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue<ItemType>().AsStringValue());
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace SabreTools.DatItems.Formats
|
||||
Link3 = this.Link3,
|
||||
};
|
||||
sourceDetails.SetFieldValue<DupeType>(DatItem.DupeTypeKey, GetFieldValue<DupeType>(DatItem.DupeTypeKey));
|
||||
sourceDetails.SetFieldValue<Machine>(DatItem.MachineKey, GetFieldValue<Machine>(DatItem.MachineKey));
|
||||
sourceDetails.SetFieldValue<Machine>(DatItem.MachineKey, GetMachine());
|
||||
sourceDetails.SetFieldValue<bool?>(DatItem.RemoveKey, GetBoolFieldValue(DatItem.RemoveKey));
|
||||
sourceDetails.SetFieldValue<Source?>(DatItem.SourceKey, GetFieldValue<Source?>(DatItem.SourceKey));
|
||||
sourceDetails.SetFieldValue<string?>(Models.Metadata.DatItem.TypeKey, GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue<ItemType>().AsStringValue());
|
||||
|
||||
Reference in New Issue
Block a user