private void btnShuffleTable_Click(object sender, EventArgs e) { Table.shuffleCard(); Player1.dropAll(); currentCard = null; ReDrawData(); }
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(); }
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); }
public void addCard(Card newCard) { if (newCard == null) { throw new Exception("Cannot add an invalid card!"); } Cards.Add(newCard); }
private void button2_Click(object sender, EventArgs e) { Table.CleanTable(); Player1.dropAll(); currentCard = null; ReDrawData(); }