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; } } } }
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); }
public void RemoveCard(CardPictureBox card) { Controls.Remove(card); addedCards.Remove(card); }