示例#1
0
 private void TimerTick(object sender, EventArgs e)
 {
     game.GameIteration();
     if (game.isOver)
     {
         if (game.delayedFinish)
         {
             Invalidate();
         }
         timer.Stop();
         var res = MessageBox.Show("Restart ?", game.finishReason, MessageBoxButtons.YesNo);
         if (res != DialogResult.Yes)
         {
             this.Close();
         }
         else
         {
             game.Restart();
             timer.Start();
         }
     }
     Invalidate();
 }