Example #1
0
 /* <summary>
  * Adds a card to the pile
  * @param: Cards card
  * </summary>
  */
 public override void AddToPile(Cards card)
 {
     if (cardList.Count == 0) {
         cardList.Add (card);
     } else {
         throw new NotImplementedException ();
     }
 }
Example #2
0
 /* <summary>
  * This method will accept a card <br>
  * A card will be inserted at the first <br>
  * position of a list
  * </summary>
  */
 public void acceptCard(Cards card)
 {
     if (cardList.Count != 0) {
         cardList.Insert (0, card);
     } else {
         AddToPile (card);
     }
 }
Example #3
0
 /* <summary>
  * Get the bottom face up card
  * </summary>
  */
 public static string getBottomFaceUp(Cards c)
 {
     return cardList.RemoveAt (0);
 }
Example #4
0
 /* <summary>
  * Get the top face up card
  * </summary>
  */
 public static void getTopFaceUp(Cards c)
 {
     return cardList[cardList.Count - 1];
 }
Example #5
0
 //will add a card to the pile
 public abstract void AddToPile(Cards card);