예제 #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();
 }