예제 #1
0
파일: Fifteen.cs 프로젝트: Akio532/lab4
 private void CancelMove()
 {
     if (f == false)
     {
         game.gameCaretaker.states.Pop();
         f = true;
     }
     if (game.counter != -1)
     {
         game.Cancel();
         RefreshButtonField();
         label1.Text = game.counter.ToString();
         game.counter--;
     }
     else
     {
         MessageBox.Show("Ходов еще не было!");
         f = false;
         RestoreGameAfter0();
     }
 }
예제 #2
0
 private void GameUndo()
 {
     if (f == false)
     {
         game.gameCaretaker.states.Pop();
         f = true;
     }
     if (game.counter != -1)
     {
         game.Cancel();
         RefreshButtonField();
         (info.Items[1] as StatusBarItem).Content = game.counter.ToString();
         game.counter--;
     }
     else
     {
         MessageBox.Show("Ходов еще не было!");
         f = false;
         RestoreGameAfter0();
     }
 }