Convert FirmwareRecord to a readonly struct
This commit is contained in:
parent
2e52827bc1
commit
a41fc1f1ce
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.Common
|
||||||
var resolved = Resolve(
|
var resolved = Resolve(
|
||||||
pathEntries,
|
pathEntries,
|
||||||
userSpecifications,
|
userSpecifications,
|
||||||
FirmwareDatabase.FirmwareRecords.FirstOrDefault(fr => fr.ID == id));
|
FirmwareDatabase.FirmwareRecords.First(fr => fr.ID == id));
|
||||||
if (resolved == null)
|
if (resolved == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -179,7 +179,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
};
|
};
|
||||||
lvi.SubItems.Add(fr.ID.System);
|
lvi.SubItems.Add(fr.ID.System);
|
||||||
lvi.SubItems.Add(fr.ID.Firmware);
|
lvi.SubItems.Add(fr.ID.Firmware);
|
||||||
lvi.SubItems.Add(fr.Descr);
|
lvi.SubItems.Add(fr.Description);
|
||||||
lvi.SubItems.Add(""); // resolved with
|
lvi.SubItems.Add(""); // resolved with
|
||||||
lvi.SubItems.Add(""); // location
|
lvi.SubItems.Add(""); // location
|
||||||
lvi.SubItems.Add(""); // size
|
lvi.SubItems.Add(""); // size
|
||||||
|
@ -531,7 +531,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
lblFirmware =
|
lblFirmware =
|
||||||
{
|
{
|
||||||
Text = $"{fr.ID.System} : {fr.ID.Firmware} ({fr.Descr})"
|
Text = $"{fr.ID.System} : {fr.ID.Firmware} ({fr.Description})"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,7 @@ namespace BizHawk.Emulation.Common
|
||||||
=> options.Add(new(new(systemId, id), ff.Hash, ff.Size, ff.IsBad ? FirmwareOptionStatus.Bad : status));
|
=> options.Add(new(new(systemId, id), ff.Hash, ff.Size, ff.IsBad ? FirmwareOptionStatus.Bad : status));
|
||||||
|
|
||||||
void Firmware(string systemId, string id, string desc)
|
void Firmware(string systemId, string id, string desc)
|
||||||
=> records.Add(new FirmwareRecord
|
=> records.Add(new(new(systemId, id), desc));
|
||||||
{
|
|
||||||
ID = new(systemId, id),
|
|
||||||
Descr = desc
|
|
||||||
});
|
|
||||||
|
|
||||||
void FirmwareAndOption(string hash, long size, string systemId, string id, string name, string desc)
|
void FirmwareAndOption(string hash, long size, string systemId, string id, string name, string desc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Common
|
namespace BizHawk.Emulation.Common
|
||||||
{
|
{
|
||||||
public sealed class FirmwareRecord
|
public readonly struct FirmwareRecord
|
||||||
{
|
{
|
||||||
public string Descr { get; set; }
|
public readonly string Description;
|
||||||
|
|
||||||
public FirmwareID ID { get; set; }
|
public readonly FirmwareID ID;
|
||||||
|
|
||||||
|
public FirmwareRecord(FirmwareID id, string desc)
|
||||||
|
{
|
||||||
|
Description = desc;
|
||||||
|
ID = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue