Esempio n. 1
0
        public void Defend()
        {
            CardPictureBox attackingCard = table.LastAddedCard();

            if (ActiveCard.Card.Suit == attackingCard.Suit || ActiveCard.Card.Suit == deck.TrumpCard.Suit)
            {
                if (ActiveCard.Card.Figure > attackingCard.Figure)
                {
                    table.AddCard(hand.UseCard(ActiveCard.Card));
                    isDefended = true;
                }
            }

            if (ActiveCard.Card.Suit == deck.TrumpCard.Suit)
            {
                if (attackingCard.Suit != deck.TrumpCard.Suit)
                {
                    table.AddCard(hand.UseCard(ActiveCard.Card));
                    isDefended = true;
                }
                else
                {
                    if (ActiveCard.Card.Figure > attackingCard.Figure)
                    {
                        table.AddCard(hand.UseCard(ActiveCard.Card));
                        isDefended = true;
                    }
                }
            }
        }
Esempio n. 2
0
 public void AddCard(CardPictureBox card)
 {
     Controls.Add(card);
     card.Size     = new Size(Height * card.Image.Width / card.Image.Height, Height);
     card.Location = new Point(card.Width * (addedCards.Count), 0);
     card.SizeMode = PictureBoxSizeMode.Zoom;
     addedCards.Add(card);
 }
Esempio n. 3
0
 public void RemoveCard(CardPictureBox card)
 {
     Controls.Remove(card);
     addedCards.Remove(card);
 }