diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-04-23 03:57:30 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-04-23 03:57:30 +0300 |
commit | 526245c8e1298eb0a5cfee0e929f054cf8033158 (patch) | |
tree | 2e8b6398f9b21e7576b0b20566f2caae3b99dd40 /FdsBlockFileAmount.cs | |
parent | 3eeeea564cd5446d3692c16af8c0d19ec674d127 (diff) |
FDS blocks are IEquatable now
Diffstat (limited to 'FdsBlockFileAmount.cs')
-rw-r--r-- | FdsBlockFileAmount.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/FdsBlockFileAmount.cs b/FdsBlockFileAmount.cs index ff73bef..c2dd0dd 100644 --- a/FdsBlockFileAmount.cs +++ b/FdsBlockFileAmount.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace com.clusterrr.Famicom.Containers
{
- public class FdsBlockFileAmount : IFdsBlock
+ public class FdsBlockFileAmount : IFdsBlock, IEquatable<FdsBlockFileAmount>
{
private byte blockType = 2;
/// <summary>
@@ -42,5 +42,10 @@ namespace com.clusterrr.Famicom.Containers public byte[] ToBytes() => new byte[] { blockType, fileAmount };
public override string ToString() => $"{FileAmount}";
+
+ public bool Equals(FdsBlockFileAmount other)
+ {
+ return Enumerable.SequenceEqual(this.ToBytes(), other.ToBytes());
+ }
}
}
|