Beispiel #1
0
 public Card(int value, CardSuit_Enum suit)
 {
     if (value < 1 || value > 13)
     {
         throw new System.ArgumentException("The value of the card has to be between 1 and 13");
         //value = (value % 13) + 1
     }
     this.Value = value;
     this.Suit  = suit;
 }
Beispiel #2
0
        public bool HasSameSuits()
        {
            CardSuit_Enum suit = this.Cards.Cards[0].Suit;

            for (int i = 1; i < this.Cards.Cards.Count; i++)
            {
                if (this.Cards.Cards[i].Suit != suit)
                {
                    return(false);
                }
            }
            return(true);
        }