Remove IEquatable from Card

This commit is contained in:
Petrutiu Mihai
2016-07-04 16:04:59 +03:00
parent 21327fc73f
commit aeaa1b627d

View File

@@ -4,7 +4,7 @@ using ChainOfResponssibility.Poker.Validators;
namespace ChainOfResponssibility.Poker namespace ChainOfResponssibility.Poker
{ {
public class Card : IEquatable<Card> public class Card
{ {
public const string ValidValues = "2,3,4,5,6,7,8,9,10,J,Q,K,A"; public const string ValidValues = "2,3,4,5,6,7,8,9,10,J,Q,K,A";
public const string ValidSuites = "C,H,S,D"; public const string ValidSuites = "C,H,S,D";
@@ -64,24 +64,6 @@ namespace ChainOfResponssibility.Poker
return 0; return 0;
} }
public bool Equals(Card other)
{
if (this.Value == other.Value && this.Suite == other.Suite)
return true;
return false;
}
public static bool operator ==(Card c1, Card c2)
{
return c1.Equals(c2);
}
public static bool operator !=(Card c1, Card c2)
{
return !c1.Equals(c2);
}
public override string ToString() public override string ToString()
{ {
return Value + Suite; return Value + Suite;