Exemple #1
0
 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);
     }
 }
Exemple #2
0
 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);
         }
     }
 }
Exemple #3
0
 public void Add(Card card)
 {
     deck.Add(card);
 }
Exemple #4
0
 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);
     }
 }
Exemple #5
0
 public Card(Card card)
 {
     this.rank = card.rank;
     this.suit = card.suit;
     this.faceUp = card.faceUp;
     highlight = false;
 }
Exemple #6
0
 public void AddToHand(Card card)
 {
     myHand.Add(card);
 }