public static void GuessAttempt(int Guess) { if (isCountingGameTime && CurrentCorrectAnswers.Any(x => x == Guess)) { isCountingGameTime = false; TotalTimeLeft = TotalTimeLeft.Add(RoundTimeLeft); RoundTimeLeft = new TimeSpan(0, 0, 10); GuessWasCorrect?.Invoke(); } }
public static void TimerSecondIsPassed(object sender, ElapsedEventArgs e) { if (isCountingGameTime && !processing) { if (RoundTimeLeft > new TimeSpan()) { RoundTimeLeft = RoundTimeLeft.Add(new TimeSpan(0, 0, -1)); SecondPassed?.Invoke(); } else if (TotalTimeLeft > new TimeSpan()) { TotalTimeLeft = TotalTimeLeft.Add(new TimeSpan(0, 0, -1)); SecondPassed?.Invoke(); } else { SecondPassed?.Invoke(); GameOver(); } } }