private void Game_Click(object sender, RoutedEventArgs e) { switch (((Button)sender).Name) { case "easy": logic.NewGame(0); break; case "medium": logic.NewGame(1); break; case "hard": logic.NewGame(2); break; case "veryHard": logic.NewGame(3); break; case "extrem": logic.NewGame(4); break; default: break; } }