public Chand(Card card1, Card card2, Card card3, Card card4, Card card5) { hand[0] = card1; hand[1] = card2; hand[2] = card3; hand[3] = card4; hand[4] = card5; }
//constructor. takes an array of 5 cards. public Hand(Card[] cards) { hand = new Card[5]; for (int i = 0; i < 5; ++i) { hand[i] = cards[i]; } }
//constructor, takes 5 cards public Hand(Card card1, Card card2, Card card3, Card card4, Card card5) { hand = new Card[5]; hand[0] = card1; hand[1] = card2; hand[2] = card3; hand[3] = card4; hand[4] = card5; }
public void AddCard(Card card) { if(card == null) throw new ArgumentNullException("card"); if (Cards == null) Cards = new List<Card>(); Cards.Add(card); }
public bool Equals(Card other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Suit, Suit) && other.Value == Value; }
public Chand(Card[] cards) { this.hand = cards; }