示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            var countCardAtPlayer = player1.CardList.Count;

            for (int i = 0; i < 10; i++)
            {
                if (countCardAtPlayer < 10)
                {
                    var card = dec.Draw();
                    player1.CardList.Add(card);
                    Image img            = new Image();
                    var   getImageOnCard = new GetImageOnCard();
                    var   getCardImage   = getImageOnCard.GetCard(card, null);
                    img.Source = getCardImage;
                    Button btn = new Button();
                    btn.Click  += ClickOnCardsPlayer_Click;
                    btn.Name    = card.Active.ToString();
                    btn.Content = img;
                    btn.RenderTransformOrigin = new Point(0.5, 0.5);
                    Grid.SetColumn(btn, x);
                    Player1.Children.Add(btn);
                    x++;
                }
            }
        }
示例#2
0
        private void Heap_Initialized(object sender, EventArgs e)
        {
            var card           = dec.Draw();
            var img            = new Image();
            var getImageOnCard = new GetImageOnCard();
            var getCardImage   = getImageOnCard.GetCard(card, null);

            img.Source = getCardImage;
            heap.Name  = card.Picture;
            heap.Children.Add(img);
        }
示例#3
0
        private void Button_Initialized(object sender, EventArgs e)
        {
            var card = dec.CardOnDesk();

            dec.Draw();
            var img            = new Image();
            var getImageOnCard = new GetImageOnCard();
            var getCardImage   = getImageOnCard.GetCard(card, null);

            img.Source   = getCardImage;
            heap.Name    = card.Picture;
            heap.Content = img;
        }
示例#4
0
        Button GetButton(Card card)
        {
            Image img            = new Image();
            var   getImageOnCard = new GetImageOnCard();
            var   getCardImage   = getImageOnCard.GetCard(card, null);

            img.Source = getCardImage;
            Button btn = new Button
            {
                Name    = card.Picture,
                Content = img,
                RenderTransformOrigin = new Point(0.5, 0.5)
            };

            return(btn);
        }
示例#5
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var   card           = dec.Draw();
            Image img            = new Image();
            var   getImageOnCard = new GetImageOnCard();
            var   getCardImage   = getImageOnCard.GetCard(card, null);

            img.Source = getCardImage;
            Button btn = new Button();

            btn.Name    = card.Picture;
            btn.Content = img;
            btn.RenderTransformOrigin = new Point(0.5, 0.5);
            Grid.SetColumn(btn, x);
            Player1.Children.Add(btn);
            x++;
        }
示例#6
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var countCardAtPlayer = player1.CardList.Count;

            if (countCardAtPlayer < 10)
            {
                var card = dec.Draw();
                player1.CardList.Add(card);
                Image img            = new Image();
                var   getImageOnCard = new GetImageOnCard();
                var   getCardImage   = getImageOnCard.GetCard(card, null);
                img.Source = getCardImage;
                Button btn = new Button();
                btn.Click  += ClickOnCardsPlayer_Click;
                btn.Name    = card.Active.ToString();
                btn.Content = img;
                btn.RenderTransformOrigin = new Point(0.5, 0.5);
                Grid.SetColumn(btn, x);
                Player1.Children.Add(btn);
                x++;
            }
        }