Convert FirmwareEventArgs to a readonly struct
This commit is contained in:
parent
5fa2c0ff26
commit
3a3cb0c30b
|
@ -1,13 +1,22 @@
|
|||
#nullable enable
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class FirmwareEventArgs
|
||||
public readonly struct FirmwareEventArgs
|
||||
{
|
||||
public string Hash { get; set; }
|
||||
public readonly string? Hash;
|
||||
|
||||
public FirmwareID ID { get; set; }
|
||||
public readonly FirmwareID ID;
|
||||
|
||||
public long Size { get; set; }
|
||||
public readonly long Size;
|
||||
|
||||
public FirmwareEventArgs(FirmwareID id, string? hash, long size)
|
||||
{
|
||||
Hash = hash;
|
||||
ID = id;
|
||||
Size = size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,14 +42,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
RecentlyServed.Add(new FirmwareEventArgs
|
||||
{
|
||||
ID = id,
|
||||
Hash = resolved.Hash,
|
||||
Size = resolved.Size
|
||||
});
|
||||
|
||||
RecentlyServed.Add(new(id, resolved.Hash, resolved.Size));
|
||||
return resolved.FilePath;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue