private void resetGame_Click(object sender, RoutedEventArgs e) { if (currentGame != null) { for (int i = 0; i < 20; i++) { currentGame.Reset(buttons); } currentGame = null; } }
private void startGame_Click(object sender, RoutedEventArgs e) { if (currentGame == null) { var test = Enumerable.Range(1, 20).OrderBy(x => rndGenerate.Next()).ToArray(); for (int i = 0; i < 20; i++) { buttons[i] = wrapPanel.Children[i] as Button; profInputList[i] = (test[i] - 1) % 10 + 1; } currentGame = new memoryGame(buttons, profInputList); } }