Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/nes-containers.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-04-23 03:57:30 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-04-23 03:57:30 +0300
commit526245c8e1298eb0a5cfee0e929f054cf8033158 (patch)
tree2e8b6398f9b21e7576b0b20566f2caae3b99dd40 /FdsBlockFileAmount.cs
parent3eeeea564cd5446d3692c16af8c0d19ec674d127 (diff)
FDS blocks are IEquatable now
Diffstat (limited to 'FdsBlockFileAmount.cs')
-rw-r--r--FdsBlockFileAmount.cs7
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());
+ }
}
}