Example #1
0
        public CardForm(Card C, string U)
        {
            InitializeComponent();
            EraseButton.Visible = false;
            Card1 = C;
            User = U;
            CheckCard();
                string n = Directory.GetCurrentDirectory().ToString() +  C.getZdjecie();
                this.Text = C.getNazwa();
            try
            {
                pictureBox1.BackgroundImage = Image.FromFile(n);
            }
            catch(Exception ex)
            {

            }
                
                if (posiadane.Count == 0) 
                {
                    infoLabel.Text = "Nie posiadasz jeszcze tej karty";
                    EraseButton.Visible = false;
                }
                else
                {
                    infoLabel.Text = "Posiadasz " + posiadane.Count + " takich kard";
                    EraseButton.Visible = true;

                }
            
        }
Example #2
0
 private bool compare(Card A, Card B)
 {
     if (A.getNazwa() != null)
     {
         if (A.getNazwa() != B.getNazwa()) return false;
     } 
     if (A.getRzadkosc() != null)
     {
         if (A.getRzadkosc() != B.getRzadkosc()) return false;
     }
     if (A.getKolor() != null)
     {
         if (A.getKolor() != B.getKolor()) return false;
     }
     if (A.getTyp() != null)
     {
         if (A.getTyp() != B.getTyp()) return false;
     }
     if (A.getMana() != -1)
     {
         if (A.getMana() != B.getMana()) return false;
     }
     if (A.getAtak() != -1)
     {
         if (A.getAtak() != B.getAtak()) return false;
     }
     if (A.getObrona() != -1)
     {
         if (A.getObrona() != B.getObrona()) return false;
     }
     return true; 
 }