Convert FirmwareEventArgs to a readonly struct

This commit is contained in:
YoshiRulz 2021-02-12 16:14:08 +10:00
parent 5fa2c0ff26
commit 3a3cb0c30b
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 14 additions and 12 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}