Example #1
0
        public void CardOnABoard(CardHeroes card)
        {
            MyArena.Add(card);
            foreach (CardsForm a in pMyHand.Controls)
            {
                CardHeroes cardh = null;
                int        count = pMyHand.Controls.IndexOf(a);
                if (oldIndex == count)
                {
                    CardHand.Remove(card);
                    a.Invoke((MethodInvoker)(() =>
                                             a.Visible = false));

                    CardHand.Remove(card);
                    a.Invoke((MethodInvoker)(() =>
                                             a.NameCards = ""));
                    CardHand.Remove(card);
                    a.Invoke((MethodInvoker)(() =>
                                             a.Power = 0));
                    CardHand.Remove(card);
                    a.Invoke((MethodInvoker)(() =>
                                             a.Price = 0));
                    CardHand.Remove(card);
                    a.Invoke((MethodInvoker)(() =>
                                             a.Health = 0));
                    a.Invoke((MethodInvoker)(() => a.Image = null));
                    break;
                }
            }
            foreach (CardsForm b in pMe.Controls)
            {
                if (b.Visible == false)
                {
                    b.Invoke((MethodInvoker)(() =>
                                             b.Enabled = false));
                    card.Index = b.Index;
                    index      = card.Index;
                    b.Invoke((MethodInvoker)(() =>
                                             b.Visible = true));
                    b.Invoke((MethodInvoker)(() =>
                                             b.Health = card.Health));
                    b.Invoke((MethodInvoker)(() =>
                                             b.Power = card.Power));
                    b.Invoke((MethodInvoker)(() =>
                                             b.Price = card.Price));
                    b.Invoke((MethodInvoker)(() => b.Image = (Image)Resource1.ResourceManager.GetObject(card.Name))); break;
                }
            }
        }
Example #2
0
 public void PlayCard(Card _playedCard)
 {
     CardHand.Remove(_playedCard);
 }