Пример #1
0
        private void StartB_Click(object sender, RoutedEventArgs e)
        {
            Mechanics.CreateDeck();
            GameWindow game = new GameWindow();

            game.Show();
            this.Close();
        }
Пример #2
0
 private void CardButton_Click(object sender, RoutedEventArgs e) //What happens when the card is clicked
 {
     if (!cardHere.IsBlocked())
     {
         MessageBox.Show(this.Width.ToString());
         flipping = new Thread(FlipCard);
         flipping.Start();
         Mechanics.AddToCheckCouple(this);
         BlockCard();
         Mechanics.CheckCouple();
     }
     SetImage();
 }
Пример #3
0
        public void AddCards()
        {
            int rows = Mechanics.GetDifficultyint() + 1;

            for (int c = 0; c < 4; c++)
            {
                ColumnDefinition column = new ColumnDefinition();
                table.ColumnDefinitions.Add(column);
            }
            for (int i = 0; i < rows; i++)
            {
                RowDefinition row = new RowDefinition();
                table.RowDefinitions.Add(row);
                for (int c = 0; c < 4; c++)
                {
                    CardButton crd = new CardButton(c, i);
                    table.Children.Add(crd);
                }
            }
        }
Пример #4
0
        private void UpdateDifficulty()
        {
            string diffString = Mechanics.GetDifficultyString();

            DifficultyB.Content = "Difficulty: " + diffString;
        }
Пример #5
0
 private void DifficultyB_Click(object sender, RoutedEventArgs e)
 {
     Mechanics.ChangeDifficulty();
     UpdateDifficulty();
 }