コード例 #1
0
ファイル: CardList.cs プロジェクト: jmutabaz/OOP-Solitaire
 /* <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 ();
     }
 }
コード例 #2
0
ファイル: CardList.cs プロジェクト: jmutabaz/OOP-Solitaire
 /* <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);
     }
 }
コード例 #3
0
ファイル: CardList.cs プロジェクト: jmutabaz/OOP-Solitaire
 /* <summary>
  * Get the bottom face up card
  * </summary>
  */
 public static string getBottomFaceUp(Cards c)
 {
     return cardList.RemoveAt (0);
 }
コード例 #4
0
ファイル: CardList.cs プロジェクト: jmutabaz/OOP-Solitaire
 /* <summary>
  * Get the top face up card
  * </summary>
  */
 public static void getTopFaceUp(Cards c)
 {
     return cardList[cardList.Count - 1];
 }
コード例 #5
0
ファイル: CardPile.cs プロジェクト: RepoDepo/OOP-Solitaire
 //will add a card to the pile
 public abstract void AddToPile(Cards card);