private void btnAddHand2_Click(object sender, EventArgs e) { try { myCard = new Card((RANK)cbRank.SelectedItem, (SUIT)cbSuit.SelectedItem, true); if (myCard.getRank() == 1) return; myHand2.Add(myCard); Bitmap bitmap = new Bitmap(myCard.getImage()); Graphics g = Graphics.FromImage(b1); g.DrawImage(bitmap, 5 + j * 75, 5, 71, 96); j++; pictureBox2.Image = b1; } catch (Exception err) { MessageBox.Show(err.Message); } }
public void Remove(Card card) { for(int i=0;i<deck.Count;i++) { if (deck[i] == card && deck[i].getSuit() == card.getSuit()) { deck.RemoveAt(i); } } }
public void Add(Card card) { deck.Add(card); }
private void button1_Click(object sender, EventArgs e) { try { //Deck deck = new Deck(true); //deck.Shuffle(); //Card dealCard = deck.Deal(); //Bitmap bitmap = new Bitmap(dealCard.getImage()); //pictureBox1.Image = bitmap; ////MessageBox.Show(dealCard.ToString()); myCard = new Card((RANK)cbRank.SelectedItem, (SUIT)cbSuit.SelectedItem,true); if (myCard.getRank() == 1) return; myHand1.Add(myCard); Bitmap bitmap = new Bitmap(myCard.getImage()); Graphics g = Graphics.FromImage(b2); g.DrawImage(bitmap, 5+i*75, 5, 71, 96); i++; pictureBox1.Image = b2; } catch (Exception err) { MessageBox.Show(err.Message); } }
public Card(Card card) { this.rank = card.rank; this.suit = card.suit; this.faceUp = card.faceUp; highlight = false; }
public void AddToHand(Card card) { myHand.Add(card); }