C#: What is the preferred way to handle this error?
- by Ash
I have a class 'Hand' that consists of two playing cards as below:
public class Card
{
public char r, s;
public Card(char rank, char suit)
{
r = rank;
s = suit;
}
}
public class Hand
{
public Card c1, c2;
public Hand(Card one, Card two)
{
c1 = one;
c2 = two;
}
}
In a 52 card deck we can't have two identical cards. How should I deal with an error where I accidentally instance a class with two identical cards, e.g (Ah, Ah)?
Thanks, Ash