示例#1
0
 private void btnShuffleTable_Click(object sender, EventArgs e)
 {
     Table.shuffleCard();
     Player1.dropAll();
     currentCard = null;
     ReDrawData();
 }
示例#2
0
 private void btnDealCard_Click(object sender, EventArgs e)
 {
     if (Table.getNumOfCardsInDeck() <= 0)
     {
         MessageBox.Show("There is no more cards in the deck!");
     }
     else
     {
         currentCard = Table.dealCard();
         Player1.addCard(currentCard);
     }
     ReDrawData();
 }
示例#3
0
 public void removeCard(Card existCard)
 {
     if (existCard == null) { throw new Exception("Cannot remove an invalid card!"); }
     if (getCardCount() <=0) { throw new Exception("No card can be removed!"); }
     Cards.Remove(existCard);
 }
示例#4
0
 public void addCard(Card newCard)
 {
     if (newCard == null) { throw new Exception("Cannot add an invalid card!"); }
     Cards.Add(newCard);
 }
示例#5
0
 private void button2_Click(object sender, EventArgs e)
 {
     Table.CleanTable();
     Player1.dropAll();
     currentCard = null;
     ReDrawData();
 }