Esempio n. 1
0
 private void btnRun_Click(object sender, EventArgs e)
 {
     BoardPicture.Update();
     if (!_gm.HasInit())
     {
         _gm.Init();
         _game = new Thread(Run);
         _game.Start();
     }
     _pause = false;
 }
Esempio n. 2
0
 private void refresh()
 {
     BoardPicture.Refresh();
     for (int i = 0; i < edgeCount; i++)
     {
         for (int j = 0; j < edgeCount; j++)
         {
             board[i, j] = Horse.none;
         }
     }
     playbutton.Enabled = false;
 }
Esempio n. 3
0
 private void Run()
 {
     while (!_closed)
     {
         if (!_pause)
         {
             _gm.NextStep();
             BoardPicture.Invalidate();
         }
         Thread.Sleep((int)(_gm.TimeStep * 1000 / _displaySpeed));
     }
 }
Esempio n. 4
0
 private void BoardPicture_SizeChanged(object sender, EventArgs e)
 {
     BoardPicture.Refresh();
 }