mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Mostly finished implementation of the new deck? ALso added some tests
This commit is contained in:
17
src/Nadeko.Econ/Deck/Regular/RegularCard.cs
Normal file
17
src/Nadeko.Econ/Deck/Regular/RegularCard.cs
Normal 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();
|
||||
}
|
Reference in New Issue
Block a user