Beispiel #1
0
 private void HandleNameMenuItem(object sender, RoutedEventArgs e)
 {
     NameInformationWindow dialog = new NameInformationWindow();
     dialog.Owner = mainWindow;
     dialog.ShowDialog();
     playerName = dialog.GetName();
     mainWindow.GameStatus.Text = "Status: Ready player 1";
 }
Beispiel #2
0
 private void HandleNameMenuItem(object sender, RoutedEventArgs e)
 {
     NameInformationWindow dialog = new NameInformationWindow();
     setNameInformationDialogOwner(dialog);
     dialog.ShowDialog();
     getPlayerNames(dialog);
     changeState();
     updateNameMenu(); 
     updateGameState();                       
 }
Beispiel #3
0
 private void getPlayerNames(NameInformationWindow dialog)
 {
     if (state == State.WAIT_PLAYER1_NAME)
     {
         player1Name = dialog.GetName();
     }
     else if (state == State.WAIT_PLAYER2_NAME)
     {
         player2Name = dialog.GetName();
     }
 }
Beispiel #4
0
 private void setNameInformationDialogOwner(NameInformationWindow dialog)
 {
     if (state == State.WAIT_PLAYER1_NAME)
     {
         dialog.Owner = player1Window;
     }
     else if(state == State.WAIT_PLAYER2_NAME)
     {
         dialog.Owner = player2Window;
     }
 }