private void BtnPartA_Click(object sender, RoutedEventArgs e) { if (game != null || gameDrawer != null) { EndGame(); } tbResult.Text = ""; Thread.Sleep(1000); game = new Game(tbCode.Text); gameDrawer = new GameDraw(ref tbResult, ref tbScore, ref game); gameDrawer.Start(); game.PlayThread(); }
private void BtnPart2_Click(object sender, RoutedEventArgs e) { if (game != null || gameDrawer != null) { EndGame(); } tbResult.Text = ""; Thread.Sleep(1000); game = new Game(tbCode.Text); gameDrawer = new GameDraw(ref tbResult, ref tbScore, ref game); gameDrawer.Start(); game.PlayUnlimited(); LeftButton.IsEnabled = true; StayButton.IsEnabled = true; RightButton.IsEnabled = true; }