private void StartB_Click(object sender, RoutedEventArgs e) { Mechanics.CreateDeck(); GameWindow game = new GameWindow(); game.Show(); this.Close(); }
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(); }
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); } } }
private void UpdateDifficulty() { string diffString = Mechanics.GetDifficultyString(); DifficultyB.Content = "Difficulty: " + diffString; }
private void DifficultyB_Click(object sender, RoutedEventArgs e) { Mechanics.ChangeDifficulty(); UpdateDifficulty(); }