Mostly finished implementation of the new deck? ALso added some tests

This commit is contained in:
Kwoth
2022-07-21 06:55:15 +02:00
parent 9a21ba3d53
commit c8c0b27d6a
10 changed files with 167 additions and 37 deletions

View File

@@ -0,0 +1,17 @@
namespace Nadeko.Econ;
public sealed class RegularCard : NewCard<RegularSuit, RegularValue>
{
public RegularCard(RegularSuit suit, RegularValue value) : base(suit, value)
{
}
private bool Equals(RegularCard other)
=> other.Suit == this.Suit && other.Value == this.Value;
public override bool Equals(object? obj)
=> ReferenceEquals(this, obj) || obj is RegularCard other && Equals(other);
public override int GetHashCode()
=> Suit.GetHashCode() * 17 + Value.GetHashCode();
}