Example #1
0
 private void Connect_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(UserName.Text))
     {
         MessageBox.Show("Please, enter username!");
     }
     else
     {
         GameClient gameClient = new GameClient(UserName.Text, Thread.CurrentThread);
         if (gameClient.StartClient())
         {
             MainWindow mainWindow = new MainWindow(gameClient, UserName.Text, ships);
             mainWindow.Show();
             Hide();
         }
     }
 }