Example #1
0
 /// <summary>
 /// check if the 2 cards have the same color
 /// </summary>
 /// <param name="c">Cards to compare with</param>
 /// <returns>True if the cards have the same color</returns>
 public bool sameColor(Card c)
 {
     if (this.color.Equals(c.color))
     {
         return true;
     }
     return false;
 }
 //Player's methods
 /// <summary>
 /// Draw a specific card from the player's deck
 /// </summary>
 /// <param name="card">the card to draw and display on the board</param>
 /// <returns>the cards from the player's deck</returns>
 public Card draw(Card card)
 {
     Card c = cards.Find(x => x.Equals(card));
     cards.Remove(card);
     return c;
 }
Example #3
0
 /// <summary>
 /// Check if the cards have the same value
 /// </summary>
 /// <param name="c">Cards to compare with</param>
 /// <returns>True if the cards have the same value</returns>
 public bool sameValue(Card c)
 {
     if (this.value.Equals(c.value))
     {
         return true;
     }
     return false;
 }