public bool isPartOfGraveyard(CardGUIModel card)
 {
     if (listOwnGraveyard.Contains(card) || listOppGraveyard.Contains(card))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
        public SelectGUI_CardGUIModel(CardGUIModel cardGUI, GUIWindows.GUISelect parent_, Thickness margin)
        {
            logger       = new Log.Logger();
            this.cardGUI = cardGUI;
            parent       = parent_;

            // Border
            Border        = new Border();
            Border.Width  = 73;
            Border.Height = 100;
            Border.HorizontalAlignment = HorizontalAlignment.Left;
            Border.Margin          = margin;
            Border.BorderThickness = new Thickness(5);
            Border.BorderBrush     = Brushes.Transparent;
            TranslateTransform t = new TranslateTransform(0, 0);

            Border.RenderTransform = t;
            Border.Visibility      = Visibility.Visible;

            // Button
            Btn        = new Button();
            Btn.Style  = parent.FindResource("cardButtonStyle") as Style;
            Btn.Cursor = System.Windows.Input.Cursors.Hand;

            Btn.Click += Btn_Click;

            Border.Child = Btn;

            // Image
            Image = new Image();
            try
            {
                if (cardGUI.Card == null)
                {
                    Image.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "/Images/GUI/CardBack.png", UriKind.Absolute));
                }
                else
                {
                    Image.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "/Images/Cards/" + cardGUI.Card.Name + ".png", UriKind.Absolute));
                }
            }
            catch (Exception ex)
            {
                logger.Log(ex.ToString());
            }

            Image.Stretch = Stretch.UniformToFill;
            Btn.Content   = Image;
        }