예제 #1
0
        public void OnGameStateChange(object sender, GameStateEventArgs gameStateEventArgs)
        {
            if (gameStateEventArgs.IsQuitting)
            {
                _printSeriesTimer.Stop();
                DisplaySeries(this, null);
                DisplayGoodbye();
                return;
            }

            if (_printSeriesTimer == null)
            {
                return;
            }
            if (gameStateEventArgs.IsPaused)
            {
                _printSeriesTimer.Stop();
                DisplayPause();
            }
            else
            {
                _printSeriesTimer.Start();
                DisplayResumed();
            }
        }
예제 #2
0
 private void GameStateChanged(object sender, GameStateEventArgs e)
 {
     if (e.IsQuitting)
     {
         _output.ReadLine();
         Environment.Exit(0);
     }
     else
     {
         Paused = e.IsPaused;
     }
 }