Exemplo n.º 1
0
 void PlayerTryShift(Direction direction)
 {
     if (lattice.TryShift(direction))
     {
         lattice.RandomSet();
         ShowLattice();
         if (lattice.IsGameOver)
         {
             using (var dialog = new MessageDialog(
                        this,
                        DialogFlags.DestroyWithParent,
                        MessageType.Info,
                        ButtonsType.Ok,
                        "Game over!"))
             {
                 dialog.Run();
                 dialog.Hide();
             }
             return;
         }
     }
 }